We have a bunch of post functions on a workflow that creates sub-tasks. It's working perfectly but what we are looking to do is create a Modify workflow. So if someone wants to modify the parent ticket it will automatically reopen any subtasks that are completed, push all of the custom field values to the subtasks and modify the summary of each of the subtasks with a MODIFIED prefix.
Can someone point me in the right direction on how to accomplish this easily?
Thank you so much in advance!
If you want the actions to be triggered on any update of the parent, rather than transitions only, then you will want to use a custom script listener on the Issue Updated event.
To update each of the child issues you should probably be able just to use a single IssueService action per issue, namely the transition action. You can update the custom field values and summary at the same time by passing their new values to the IssueService via the IssueInputParameters: the service will perform the transition and update in one go, the same as if you had edited the field values on the transition screen before submitting.
Let me know if you need me to expand on any of the above, I'm happy to write some example code although it may take me a little longer.
Apologies for the delay in getting back to you. Here is an example of how to transition an issue while updating its summary and a custom field value. Note that the custom field value needs to be provided as a string irrespective of its type: the correct formats for doing this are detailed in the Atlassian documentation.
def is = ComponentAccessor.issueService
def u = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issue = ComponentAccessor.issueManager.getIssueObject("ISSUE-6")
def iip = is.newIssueInputParameters()
iip.summary = "MODIFIED " + issue.summary
iip.addCustomFieldValue(10033, "30/Dec/05 5:35 PM")
iip.skipScreenCheck = true
def vr = is.validateTransition(
Did you know that penalties up to 4 % of the yearly company turnover are possible in case of GDPR violations? GDPR regulations are currently mainly relevant for companies in the EU, but countries lik...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events