Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Attach form to multiple tickets using field and branching

Danny Marshall May 27, 2025

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.

firefox_NYbLcaLNtj.png

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.

2 answers

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2025

Hi @Danny Marshall 

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:

  • trigger: work item created
  • if / else block
    • condition: option A is selected in the field
    • action: create work item
    • branch: to most recently created work item
      • action: copy forms from the trigger one
  • if / else block (Note this is a new block and not a continuation of the earlier one.)
    • condition: option B is selected in the field
    • action: create work item
    • branch: to most recently created work item
      • action: copy forms from the trigger one
  • ...

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

Danny Marshall June 2, 2025

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

firefox_aDAiMTHqJm.pngI tried the following code:

https://api.atlassian.com/jira/forms/cloud/{couldId}/issue/{{issue.key}}/form/copy/{{issue.issuelinks.inwardIssue.key}}

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.

https://api.atlassian.com/jira/forms/cloud/c187abf1-cc5d-4c09-b649-5d01a2d8f0c1/issue/{{issue.key}}/form/copy/{{issue.issuelinks.get(0).inwardIssue.key}}

Is there a way to iterate over the newly tickets created with a smart value?

Kind Regards,

Danny

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2025

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.

0 votes
Luka Hummel - codefortynine
Atlassian Partner
May 30, 2025

Hi @Danny Marshall

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events