Automate Issue Creation from one JIRA instance to another JIRA instance

This is mostly configured when you're using a JIRA Server instance, but you can also do it with JIRA Cloud.

Configure locally two instances (one JIRA Software and other JIRA Service Desk) in order to configure rules to work with this.

It was possible to do that by configuring rules on Automation for JIRA on both instances. So these are the requirements for this to work:

  • Automation for JIRA must be installed on both instances, the one which is sending the webhook with the JIRA issue that was created and the one which is receiving the webhook with the JIRA issue.
  • You must have created the project on JIRA Software instance in order to receive the issues created dynamically.
  • You'll need to create two rules, one rule into the "sending webhook" instance and other rule into the "receiving webhook" instance.

Let me jump into the rules I've configured in order to make it work:

Rule for JIRA Service Desk instance:

image.png

 

This rule will be responsible for sending the webhook onto the JIRA Software instance. Follow the description of each field on "Send web request" action:

  • Webhook URL: This URL is retrieved when creating the rule on JIRA Software instance. Please check on the description under the "Rule for JIRA Software instance" section.
  • Headers (optional): You must insert the same headers as on the screenshot ("Content-Type" and "application/json") in order for this to work correctly.
  • HTTP method: It is POST because you're sending information towards the webhook URL.
  • Webhook body: Select "Issue data" just to make things simpler and so you'll be sending all the issue data.

 

Rule for JIRA Software instance:
Screenshot 1:
image.png

Screenshot 2:
image.png

This rule will be responsible for receiving the webhook from the JIRA Service Desk instance. Follow the description of each field on both Screenshot 1 and Screenshot 2.

Fields on Screenshot 1:
  • Webhook URL: This is the URL that we'll need to use on the "Webhook URL" field of the previous rule in order to direct the data towards this application. Copy and paste it carefully on the first rule.
  • Execute this automation rule with:: Select "Issues provided by webhook HTTP POST body" as we are sending the issues directly through the POST body;
Fields on Screenshot 2:
  • Project: Here you'll need to select the project under your JIRA Software instance that must receive all the issues that will be created from the JIRA Service Desk issues;
  • Issue Type: Here you must select the issue type that the issue will be created on. In case you need to create issues from different issue types, it is possible to add some conditions with "If block condition" and make separate "Create Issue" actions for each of the issue types.
  • Summary and Description: Here we must use a "Smart value" that works as a way of retrieving data that came from the "Webhook data". The logic for this specific scenario is that the "webhookData" object contains the "fields" object in which all the fields are inside. So, for the summary I've used {{webhookData.fields.summary}} and for the description I've used {{webhookData.fields.description}}. You'll need to add all the fields you want under the "Choose fields to set" option and then use the same logic to get the field values from the webhookData object.

Tips for implementation:

  • In order to gather the Webhook URL, start both rules creation at the same time, so you can easily copy and paste the value;
  • Start implementing this with only summary and description fields and then you can improve by searching for the fields one-by-one;
  • I've added a "Log action" action on the rule for JIRA Software instance in order to understand what was inside of the "webhookData" smart value, so I was able of figuring out the pattern that we need to follow to retrieve the fields as we wanted.

22 comments

Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 30, 2020

@Victor Seger  Thanks for sharing this nice automation tip.

Like Victor Seger likes this
cfranke October 5, 2020

@Victor Seger 

Thanks for sharing, this helped me a lot!  I have a question about linking between Jira Cloud instances.

When a manager requests an Onboard, Offboard or Transfer in our HR Instance, I have a rule that creates an IT Task in the HR instance.  A web hook posts the IT Task details to our IT Instance and creates a new request (Request Type=HR Request).  How do I link the IT Task in HR to the HR Request in IT?

Once linked, I also need to update the IT Task in HR to Resolved when the HR Request in IT is Resolved.

Any guidance you can provide would be greatly appreciated!

Thank you!

Carla

Like Victor Seger likes this
Salome Khaindrava
Contributor
January 7, 2021

@Victor Seger  Automation is just what we need, Thanks. But we have a problem with Incoming Webhook. The audit log says "No issues from the webhook". Can you help with that?

Like Victor Seger likes this
Victor Seger
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2021

@cfranke @Salome Khaindrava , We can help you both on that.

Can you please open a ticket on support.atlassian.com? 

By opening a ticket we can give you a closer support experience and try to help you properly.

cfranke January 7, 2021

@Victor Seger I did open a ticket, they helped with workarounds, but we could not get status updates to transfer back to the original system though I was told that a solution would be deployed by the end of 2020, but I do not know if that has happened or not.

Like Victor Seger likes this
Salome Khaindrava
Contributor
January 7, 2021

@Victor Seger  Thanks, we figured it out. We had to choose the "No issues from the webhook" option for it to work. We will continue research and then open a ticket if it will be necessary.

Like Victor Seger likes this
Alfredo Palacios April 13, 2021

Hello there, kindly show your ideas to proper format the url so I can send custom data: 

issues[]=TEST-1&data[BT24]=13456 

then when using {{webhookData}}, 13456 is not read 

Like Victor Seger likes this
Lenny Tabakman
Contributor
May 20, 2021

@Victor Seger Your method worked for me to create an issue in a different Jira Cloud instance than the trigger issue. The only thing I had to change was choose No issues from the webhook option but I was still able to transfer issue data from the trigger issue to the created issue on the other cloud instance. 

Separately, I linked the two cloud instances together through Application Links and I am now able to manually link Jira issues to each other from different instances. I am wondering if you have a solution to automatically create that link. I have the URL and key from the target instance but there is no option to use smart values in Automation for Jira to create that cross-instance link. Nor can I find a way to do this through post-functions.

Thank you for posting this article!

Like # people like this
Pablo Serra
Contributor
June 14, 2021

Hi @Victor Seger,

Is it possible to use a similar rule to update existing issues on the remote instance?

Thanks in advance!

Pablo

Victor Seger
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2021

@Pablo Serra , it should probably work! You'll only need to change some of its components in order to have them updating issues instead of creating them.

I'll also add that you might need to do some local testing as I didn't tested this yet.

cfranke June 14, 2021

Just to let everyone know, 8 months later I do not have a resolution on this. I can get the issue in the 2nd instance created, but there is still no way to update the trigger issue in the first instance when the issue in the 2nd has been resolved.

The instance I built has gone unused as a result of that and other internal factors.

Lenny Tabakman
Contributor
June 14, 2021

You can update the trigger issue if you send over the original key and store it in the second instance's issue in a custom field when you create the issue in the second instance. I have successfully tested a separate web hook automation that updates the original issue from the second issue, using the key. 

Like # people like this
cfranke June 14, 2021

@Lenny Tabakman 

The workaround that Atlassian employed to create the issue in the other instance will not send over the key.  It would have worked if both projects are on the same instance, but it didn't work when creating in a separate instance.  They might have deployed updates in the past 8 months since so that it works, but it didn't back then, and like I said the team for which I built the instance never deployed it.  I'll definitely look into it if that project ever gets back off the ground.

Pablo Serra
Contributor
June 14, 2021

@Lenny Tabakman I'm interested in the rule you've mentioned earlier, could you give me some details on how to set it up? Thanks! Pablo

Lenny Tabakman
Contributor
June 14, 2021

I set the Webhook body option to Issue data on my Send web request action. Then on the Incoming Webhook automation on my receiving instance, I saved the key of the trigger issue by using smart value: {{webhookData.key}} into a text custom field. Then you can configure another automation which sends a webhook back to the original instance with the issue data included and use the custom field smart value with JQL to operate on the original trigger issue, like "key = {{webhookData.fields.customfield_12471}}"

Like # people like this
Pablo Serra
Contributor
June 18, 2021

Thanks Lenny!

Darren Weake
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2021

@Lenny Tabakman - I'm interested also in what you've done. I'm using Jira DC and Jira Cloud, and have automation set up to send a webhook from DC to Cloud to create an issue on a certain trigger. I'd love to be able to automate setting up the linking automatically, but haven't worked out how. Do you know if its possible using the custom field solution you used to update your original Jira issue? Thanks!

Lenny Tabakman
Contributor
July 26, 2021

@Darren Weake I have not found anything for automating the creation of the link between two issues in different instances. I have just chosen to display the URL in a custom field and manually create the link.

Greg D
Contributor
November 13, 2021

@Lenny Tabakman I was also digging to see if I could link programmatically between two Cloud instances.  Seems like you would need to do it programmatically using remote links via the API (Jira Cloud REST API - Create remote issue link... the RemoteObject link in that section displays more details).  Here is someone else explaining how to format it:  Jira API issueLink connect two different instances - Stack Overflow (probably would need to loop through with an external script to add many links).

 

As a less complex solution, in new issue view if you add a link to any Cloud instance's issue into the Description, Comment, or any other Multi-line/Paragraph field and you format it as [http://your-site.atlassian.net/ISSUE-123|http://your-site.atlassian.net/ISSUE-123|smart-link] it will actually display the issue with its status in that section (so essentially the same thing as a remote link).

Just make sure you are using a method of adding it that allows that markup (Automation likes that format, but the newer REST may need to be formatted differently).  That might be a lighter-weight way to do it via Automation unless you absolutely need it to be under a specific link type.  I use that method in a lot of scenarios.

Like # people like this
Lenny Tabakman
Contributor
November 15, 2021

@Greg D Thanks for the tip about the multi-line fields being able to display the smart link. I did not know this also works across instances.

Like Greg D likes this
Yurii Zhatkin
Contributor
March 1, 2023

Hi community, 

How do I create reciprocal links between issues if I create the issue from one instance to another? Could anyone share their experience? 

Simon
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 1, 2023

Thanks for this article and the comments.

In case it helps anyone I had to set "Issue data: Automation Format" and  "No issues from the webhook" and then it worked.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events