i am using jira software cloud instance and also having scriptrunner installed. i want to get parent issue key from its subtask on one of the transition using scriptrunner.
or can i copy one custom field value from subtask to its parent issue type field?
We have an example here where it shows how to sum up values from fields on a subtask and store them in the parent. You can use this example as a guide/reference to help create the script that you require.
I hope this helps.
Thank you
Kind Regards
Kate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello in a transition you can get the key (or any other field from the parent of a subtask)
public String getParentKey(issue){
def parent = issue['parent'] as Map
parent.key
}
Such a function returns the parent key
If what you need is to copy info from the subtask to the parent you have to obtain the values of the fields, build a map and perform an update of the parent
public static void updateIssue(issueKey, updateMap){
def result = put("/rest/api/2/issue/${issueKey}")
.queryString("overrideScreenSecurity", Boolean.TRUE)
.header("Content-Type", "application/json")
.body([fields:updateMap])
.asString()
if(result.status != 204)
throw new Exception(result.body)
}
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.