Hello
I am new to ScriptRunner and JIRA API.
I am trying to add post function in a transition in the workflow that it returns the destination link of the issue.
It appears the following contains the link
com.atlassian.jira.issue.link.getDestinationObject
Is that correct?
If so, what method in getDestinationObject can I call to return the link?
In terms of syntax in ScriptRunner, what should I use?
Thanks
The com.atlassian.jira.issue.link.IssueLink is what the getDestinationObject method is from.
This class is what describes objects that links an issue to other issues. That has nothing to do with the URL.
I am not aware of a direct way to get the URL from an issue object.
But as far as I know, all Issue URLs are formed by ${jiraBaseURL}/browse/${issue.key}.
So, in a post function script (issue object is already defined), you can do something like this:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
def baseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)
def issueUrl = "$baseUrl/browse/$issue.key"
My pleasure.
Be sure to click the accept answer so that others can find it and it will appear as "solved".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The package/class/method of com.atlassian.jira.issue.link.getDestinationObject is not a URL - this is associated with linking issues in Jira together as mentioned here. The getDestinationObject() method returns an Issue object.
Is this URL supposed to be in a comment? Is it supposed to be saved in a custom field? What is your intention with this URL? That would determine how you need to create your script post-function, in my opinion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.