Forums

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

Get transition name with Automation

Vando Goncalves _e-Core_
Community Champion
April 13, 2020

Hey guys, how are you doing?

Here's what I need to do: from an incident or Service Request, to be able to create a Change or a Problem.

As I have just Automation for Jira, I'm addressing it this way:

I have 2 "general" transitions (the ones that go from any status to itself) on my workflow: Create Change and Create Problem.

Then, I have an automation which creates a change, with an IF to check is the status changed from it to itself ({{changelog.status.fromString}} == {{changelog.status.toString}}), but, this is triggering both automations.

I wanted to make an if clause, to check which transition was made.

Is this possible to achieve using smart values? Or any other if condition?

1 answer

1 accepted

4 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2020

Hi Vando,

I'm well, thanks for asking.  I see that you are looking to use some kind of smart value to distinguish these two different looped transitions.   I do not believe there is any such smart value that will help in regards to being able to know the name of the transition called. The available smart values in Smart values - general simply do not extend to that info.

However I think there is a way you could make this work.  I would actually look to adjust the workflow here.  In Jira Cloud you could easily change the workflow for one of these transitions so that you could add a post function of type "Update Issue custom field" to one of these transitions.  It could then change the custom field to some value that is unique to that transition.  I recommend that this post function come before the one called 'Re-index an issue..' to try to make sure we avoid any race conditions.

You could then try to check for the existence of that custom field value on the issue to see which transition executed it.  To make this work, you would need to also change the workflow of the other transition and give it a different value to set.  That way the custom field could be overwritten by each of these transitions and in turn should only trigger the automation actions of the most recent transition.

Let me know if this helps.

Andy

Vando Goncalves _e-Core_
Community Champion
November 19, 2020

Hey Andy!

Took me a while to get back to this, sorry!

I just did as you said, and it worked!

 

Thanks so much!

Like Andy Heinzer likes this
Martin Böhme
Community Champion
March 29, 2021

Great Idea, Andy!

That helped me, too.

Thanks

Like # people like this
Nadia
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.
February 11, 2022

That's cool, was looking for a way to make that happen too

Suggest an answer

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

Atlassian Community Events