Forums

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

Jira Automation Unable to Clone due to Issue Key not being found

Kathryn Kerr November 14, 2024

Hello,

For some reason my Jira Automation is unable to clone a ticket from one project to another because it's running into this error: 

 

Clone Issue
Error creating issue
Bad Request (400)
Issue was created successfully, however some unexpected errors occurred -

LINK ISSUES
Error linking issues
: At least one of 'id' or 'key' is required to identify an issue.

Also, it says the issue was created successfully, but when I try to find the cloned issue there is nothing to be found.

Here is how the automation is set up:

There are no issues in the automation until it gets to the cloning/linking part.

Our actor is also Jira Automation, so there is no issues with a user not having the correct privilege.

image.png


I have tried to manually clone the problem issues, and they will clone, just not through the automation.

I also tested a few issues from last quarter, and they are able to clone from the automation. I even tried some manual test tickets from Q3 and they work as well, so it's not an issue with the fields.

However, I tested a ticket one of my team members manually created for Q3 and we could not get it to clone through the automation.

I am worried there may be an issue with previous quarter and current quarter tickets because of how they were imported. I am a bit skeptical because there are also issues with manually created tickets.

Previous quarter tickets were imported via the External System Import in the system settings. This quarter, the tickets were imported via the 'Import issues from CSV' button. Despite this, all the files we have ever uploaded to create tickets have always been CSV files, so that has not changed.

I don't know if this is a bug or if it is user error.

Thank you!

4 answers

1 accepted

1 vote
Answer accepted
Kathryn Kerr November 15, 2024

Hi Everyone! The issue was that it was a multi project clone and the source ticket from Project A did not contain of all the required fields to create a ticket in Project B. Thank you all so much for your help :)

3 votes
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.
November 14, 2024

Hi @Kathryn Kerr 

What is the scope of your rule (in the details at the top): single-project, multiple-project, or global?

A single-project scope rule can create / clone issues into other projects, but it cannot access them otherwise.  Link Issues is trying to edit the other issue, and so that will fail in a single-project scoped rule.

To solve this, please change the rule scope to multiple-project (or global as needed).  Your Jira Site Admin will need to help do that change in the global automation area of Jira.

Kind regards,
Bill

Trudy Claspill
Community Champion
November 14, 2024

It is possible to create Links within the Clone issue action, isn't it? Would that circumvent the problem?

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.
November 14, 2024

Hi @Trudy Claspill 

Yes, that is possible for one-and-only-one link during issue create.  (I believe that is all that is currently supported by the REST API.)

So, the workaround for a single-project scope is to add the link with JSON like this using an update in an advanced edit:

{
"update": {
"issuelinks": [
{
"add": {
"type": {
"name": "Relates"
},
"outwardIssue": {
"key": "{{triggerIssue.key}}"
}
}
}
]
}
}

I just tested to confirm this still works for issues created in other projects with a single-project scope rule.

Kind regards,
Bill

Like Trudy Claspill likes this
2 votes
Manoj Gangwar
Community Champion
November 14, 2024

Hi @Kathryn Kerr if you are getting 400 bad request then please raise a ticket with atlassian vendor. https://support.atlassian.com/

For some automation rule, we are also getting the 400 error so atlassian is investigating on it. 

Kathryn Kerr November 14, 2024

Thank you! I will definitely do that

1 vote
Trudy Claspill
Community Champion
November 14, 2024

Hello @Kathryn Kerr 

What is the output in the rule execution log?

The trigger is a Field Value Change, but is that change coinciding with the issue being created, or is that change happening on issues that already exist?

If it is on an issues that is has just been created then you might want to try adding a Re-fetch action.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events