How can you programmatically (scriptrunner-groovy) assign a validation script to a workflow.

Tim Thompson May 25, 2022

I have a standard validator (one scriptrunner script) that I want to apply to multiple workflow transitions across 100s of projects. Too many to do manually and I cannot share the workflow as one issuetype the project admins may modify for their project (other controls built to manage that). 

I have build a script that given a project it

1. loops issue types (IssueTypeSchemeManager.getIssueTypesForProject)

2. retrieves the workflows (WorkflowManager.getWorkflow(thisPROJECT.id, it.id) and

3. loops actions, validators and args

     theWORKFLOW.getAllActions().each {  it.getValidators().each { it.getArgs().each { it.getKey()

My hunch is the name of the script is buried somewhere in args key FIELD_FUNCTION_ID or FIELD_CONDITION value using the hashCode but since Jira uses com.opensymphony.workflow I'm stuck there.

I am hoping once I can find one that has been manually set, I can decrypt and then re-encrypt and assign to other workflows. 

Any suggestions? Not finding much out there about  com.opensymphony.workflow.

0 answers

Suggest an answer

Log in or Sign up to answer