Forums

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

When a field is updated an issue must be created

André Felipe Rodrigues Lopes
Contributor
July 31, 2024

I have two instances in Jira, in my instance #1 I need to update a field, and every time this field is updated a new issue needs to be created in my instance #2, I tried a few ways including using the send web request. Does anyone have any idea how to do this?

3 answers

2 accepted

1 vote
Answer accepted
Matthias Gaiser _K15t_
Community Champion
August 1, 2024

Hey @André Felipe Rodrigues Lopes

if you only want to create the issue in the other instance, I'd also recommend using a Jira automation with a web request.

With the web request, you need to call the create issue endpoint of the other instance. Here are some simple details you can use:

  • Web request URL: https://YOURDOMAIN.atlassian.net/rest/api/2/issue
  • HTTP method: POST
  • Web request body: Custom data
  • Custom data: Here goes the actual payload with all the data about the new issue to create. As an example, this request creates a Task in the project PROJECTKEY with the summary "create test"
    {
      "fields": {
        "summary": "create test",
        "project": {
          "key": "PROJECTKEY"
        },
        "issuetype": {
          "name": "Task"
        }
      }
    }
  • HTTP headers
    • Key: Content-Type, Value: application/json
    • Key: Authorization, Value: Your username and API token (as explained below)

Note on username API token
To call the REST API, you need to create an API token for the user you want to use for the create call. Please follow the docs to do so. 

You then need to encode your mail address with the API token, e.g. mail@example.com:APITOKEN with Base64, e.g. using this online tool. Then you can use that Base64 encoded content in the authorization header, adding "Basic" before, e.g. "Basic asdf234".
Hope that gets you started with your web request.
Cheers,
Matthias.
André Felipe Rodrigues Lopes
Contributor
August 1, 2024

Thank you @Matthias Gaiser _K15t_ 

Dude, your answer was so complete that it even helped me with things I hadn't asked about, lol

Like Matthias Gaiser _K15t_ likes this
0 votes
Answer accepted
Hans Polder _Devoteam_
Community Champion
July 31, 2024

@André Felipe Rodrigues Lopes ,

Sending a web request should be the way to go and should work.

Can you share some screenshots of the automation rule you have configured so far, especially the web request configuration itself?

0 votes
André Felipe Rodrigues Lopes
Contributor
August 1, 2024

@Matthias Gaiser _K15t_ 

If I want to link these two issues, would I do it in the request body or in this case just add another action to link the two issues?

Matthias Gaiser _K15t_
Community Champion
August 2, 2024

If you want to link the issues, you should do another web request to link them. Since this is across Jira instances, you should use the remotelink API for it as documented here.

Please note that you need an application link between the instances for that to work.

 

PS: If you want to go further and also keep the issues in sync, you can of course extend your automation actions even further. If you find that too cumbersome, you might also want to check out an issue sync app from the Atlassian Marketplace. I'm part of the team behind Backbone Issue Sync and also happy to answer any questions in this regard.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events