This article provides the code snippet to add a web link to an issue, using Scripted (Groovy) operation on issue (JMWE app) post-function.
Navigate to the intended workflow to make the necessary changes in the edit mode.
Select the required transition.
Select the Post functions tab and click Add post function
.
Add the “Scripted (Groovy) operation on issue (JMWE app)” post-function.
Add the below Groovy script:
import com.atlassian.jira.issue.link.* RemoteIssueLink link = new RemoteIssueLinkBuilder().issueId(issue.getId()).url("https://innovalog.atlassian.net/wiki").title("Innovalog").build(); ComponentAccessor.getComponent(RemoteIssueLinkManager.class).createRemoteIssueLink(link, currentUser); |
With this, the URL "https://innovalog.atlassian.net/wiki" will be linked to the current issue, with the title "Innovalog" - modify them as per your use case.
If this post-function is added on the create transition, move it below “Creates the issue originally.” built-in post-function. |