Forums

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

How Get Transition ID in conditions?

Alex
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.
June 20, 2022

Should work "Fast-track transition an issue" if conditions
1) not role Developers
2) The transition occurs only from a transaction (Waiting For Customer Reply)

my code:

import com.atlassian.jira.component.ComponentAccessor

!isUserMemberOfRole('Developers')

def workflow = ComponentAccessor.getWorkflowManager().getWorkflow(issue)

def wfd = workflow.getDescriptor()

def actionName = wfd.getAction(transientVars["actionId"]).getName()

// id transit/ (751)

if (actionName == "Waiting For Customer Reply"){

     return true
}

but for some reason it doesn't work
фцыва (1).png 

1 answer

0 votes
Florian Bonniec
Community Champion
June 20, 2022

Hi

 

You do not have access to transitionVar variable in a Listener, this variable is only available in postfunction.

 

Your listener is triggered on "Comment Issue" but you check what the action performed is, that is related to transition (An issue going from a status to another).

 

You can create a custom event, set this event instead Generic Event in the postfunction of the transition "Customer Expectation" then catch this custom event in your listener instead of Issue Commented

 

Regards

Alex
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.
June 21, 2022

@Florian Bonniec  Hi, please can you pin a screenshot ? 

Florian Bonniec
Community Champion
June 21, 2022

What are you trying to do ?

 

Does this feature from Scriptrunner solve your issue ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events