Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to clone issue with status using Automation?

Edited

We need to clone issues within the same project (same workflow).

The clone issue must retain the same original status of the cloned one.

We are trying to implement this feature with Automation.

The steps should be straightforward, as in the attached screenshot:

1. Trigger rule When Issue Created

2. If Link Issues present clones (within project)

3. The Transition the issue to COPY FROM ISSUE

 

The last COPY FROM ISSUE, as stated by the "Transition issue" action inner description, should take the status from the cloned issue and try to use it as destination status for the clone one.

Both cloned and clone issues share the same workflow.

In the workflow the "Automation for Jira" actor is enabled for transition.

The transition from created status to destination status exist.

 

However the last action (the Transition itself) of the rule fails with this log:

Transition issue
Destination status could not be resolved. If using a smart-value ensure this resolves to a numeric status ID or untranslated name for issues (with current status):
Why? What are we missing?
This is a very simple feature, so please don't propose external apps for cloning the issue.
We can use ScriptRunner in case it is neededclone rule.JPG

2 answers

@Amministratore Jira 

 

You can also try the following:


If issues are always cloned into a specific status, you can put an "All" transition on it, and direct the clone to do so.

The problem with clones using automation is that in flows, it only follows the transition lines step by step, they cannot read other transitions further away and walk the path to them.

I found a crude solution by myself, even if it is not working in 100% of cases.

For the destination status of the last transition action I used the Smart Value:

{{issue.issuelinks.first.outwardIssue.status}}

I had to copy and paste the Smart Value string in the destination status selection field.

Trying to type the text does not work... (?)

 

I also added some "global hidden transition" in the workflow, allowed only to the atlassian-addons-project-access group (i.e. Automation for Jira)

 

Luckily, IF the clone ticket is not created with the cloning links feature flagged, the only related link in the outwardIssue list is the original cloned ticket.

So we can read its status and use it for the transition. 

However it is very strange (a bug) that the same value is not read / accessible properly using the COPY FROM ISSUE value.

I also had to add some Re-fetch issue data actions in order to delay the last actions and to be sure that all fields in the clone issue have been populated by the time the rule tries to read them.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

762 views 5 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you