[copy old Key] How to copy old key to a custom field in Jira using automation

Rajesh Konda May 17, 2024

Hi Team,

 

We have a requirement to store old key of a ticket in a custom field when moving a ticket from one project to other. Basically this is been tracked on integration tool.

So, have created an automation and selected the Move event and stored the value in a variable and copied the value onto a custom field. This automation is copying the issue new key instead of old one. Can any one help me how can figure this out. Thank you in advance.

 

image.png

 

I am aware that the Key can be stored in a custom field during the ticket creation process, but there are a lot of teams in my organization, thus additional tickets will be created every day.  Don't want to breach the limit of executions, so looking to copy only moved issue key instead of all.

1 answer

1 accepted

0 votes
Answer accepted
Jeroen Poismans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2024

Hi!

I have found a Community post about that. The possible solution is burried a bit deeper in the comments:

https://community.atlassian.com/t5/Jira-questions/With-Automation-for-Jira-how-do-we-access-the-previous-key-value/qaq-p/1512600

The interesting part states:

Well, as a matter of fact, it works... And I don't know why, because it is not documented:

{{changelog.key.fromString}} gives you the previous key, and {{changelog.key.toString}} gives you the new key (as triggerIssue.key).

See if this works for you!

Jeroen

Rajesh Konda May 17, 2024

Thanks @Jeroen Poismans , this worked for me, thanks a lot.

Suggest an answer

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

Atlassian Community Events