Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,649
Community Members
 
Community Events
165
Community Groups

Please help me to write condition

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

}

 фцыва (1).png

1 answer

1 vote

Try it like this:

import com.atlassian.jira.component.ComponentAccessor

def isDeveloper = isUserMemberOfRole('Developers')
if(isDeveloper) return false //stop the condition check immediately

def
workflow = ComponentAccessor.workflowManager.getWorkflow(issue)
def actionName = workflow.descriptor.getAction(transientVars["actionId"]).name

// id transit/ (751)
actionName == "Waiting For Customer Reply" //no need for if block, just return the result of this comparison

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,598 views 37 46
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