I have a multi select field {{applicationsRequested}} that when each option is ticked it will create a new ticket and assign to a team member. On each newly created ticket I want to copy the form from the original ticket. Below is my automation which doesn't seem to work properly. All the changes seem to be occurring to the original ticket and not the new ticket.
When I create a new ticket before the branch then using "most recently created work item" branch the form copy across, however, there are 15 options in this field and so possibly I want to create 15 new issues and copy the form to each ticket.
I'm not sure how to structure this automation so the changes occur to the newly created tickets.
Short answer: your rule will need to either use a series of if / else condition blocks or use the REST API endpoint to copy the forms from the trigger work item.
It appears your scenario is:
GIVEN a multiple-selection option field for "Applications Requested"
WHEN a new work item is created
THEN for-each selection, create a new work item
AND copy the forms from the trigger work item to each newly created work item
Branches cannot be nested in rules, and because branches on more-than-one-thing execute in parallel and asynchronously, the rule cannot add all of the work items and then copy the forms later. There are two possible solutions: conditions and the REST API endpoint...
1) With conditions, use a long rule which processes each possible selection, either with if / else conditions. A simplified version of the rule would be:
UPDATE: Re-reading your question, the if / else condition approach may not work as the rule could be longer than the 65 rule component limit. Please check the math before trying to create the rule. Thanks!
2) With the REST API endpoint, fewer changes are required to your rule. Immediately after the new work item is created, use the Send Web Request action to call the REST API endpoint to copy forms. If you want to try this approach, here are some references to help:
Kind regards,
Bill
UPDATE: I used {{createdIssue.key}} which didn't work in the validator but did when I ran it.
Hi Bill,
Thanks for the information, it was very helpful, I'm trying to use the API. I am running into an issue with the api {targetIssueIdOrKey}. I don't know how to get the newly created issue keys.
This is the web request and automation rule
I tried the following code:
and it returns the following:
Your outgoing web request configuration is invalid. Please fix the following errors and try again.
I tried the following code but it only singles out the first ticket created.
Is there a way to iterate over the newly tickets created with a smart value?
Kind Regards,
Danny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The most recently created issue's key is:
{{createdIssue.key}}
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--createdIssue--
As you are creating the issue inside of the branch to then copy forms from the trigger issue, use the above one as the targetIssueIdOrKey and use the trigger as the sourceIssueIdOrKey:
{{triggerIssue.key}}
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--triggerIssue--
Try substituting those in the URL and let me know what you observe. Thanks!
And FYI -- There is another smart value for all the issues created in the running rule, but that one will not work for your case because of the branching.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what you are running into is a current limitation of Jira Automation: while it can create new issues, it cannot carry over a Jira Service Management form. If you need every newly-created ticket in your branching rule to contain an exact copy of the original form (including all field values) and are willing to us Marketplace app, take a look at our app Deep Clone for Jira.
You can also take a look here on how to implement the app in your Jira Automation.
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.