Hi,
I have set JIRA workflow transition properties (i.e key and value pair) and i want to access these properties in script runner listeners(Groovy script) but i am not able to do this. I am new in groovy script.
can anyone please help me in this, thanks in advance.
Arjun
Hello @Arjun Jadhav
You can do it via worflowManager like this
import com.atlassian.jira.component.ComponentAccessor
def workflowManager = ComponentAccessor.getWorkflowManager()
def workFlow = workflowManager.getWorkflow("workflow name")
def action = workFlow.getAllActions().find {it.name == "transition name"}
def properties = action.getMetaAttributes()
log.error("Attributes: ${properties.toString()}")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @nallu
I think something like this:
import com.atlassian.jira.component.ComponentAccessor
Map attributes = new HashMap()
attributes.put("attribute","value")
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def workFlowManager = ComponentAccessor.getWorkflowManager()
def workflow = workFlowManager.getWorkflow("Some workflow")
def status = ComponentAccessor.getConstantsManager().getStatus("Some status name")
def stepDescriptor = workflow.getLinkedStep(status)
stepDescriptor.setMetaAttributes(attributes)
workFlowManager.updateWorkflow(user, workflow)
but i don't tested
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.