Forums

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

How to automate workflow creation via scriptrunner?

Lucas Z April 23, 2020

Hello, everyone,

I'm trying to create a new empty workflow with a scriptrunner groovy script to automate the project creation process. Trying to emulate the workflow from admin ui. However, I can't find the right methods in the Jira API documentation under the WorkflowManager.

I can make a copy of the standard workflow using WorkflowManager.copyWorkflow() but it will not be empty and i'm not able to delete the existing steps. In the UI I can click the button "Add workflow" and get an empty workflow to which I can add steps one by one. How do I implement this via the API?

Can someone give me a rough overview over the related concepts and how I solve this with the API? The following points are the most important ones:

1.) create an empty workflow
2) add existing steps, status and actions
3) create workflow scheme
4) assign workflow to scheme
5) assign scheme to project

best regards
René

1 answer

0 votes
Pana Florin Ionut August 10, 2023

This is not an answer. I just want to say that I am searching for the same thing

Nic Brough -Adaptavist-
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.
August 10, 2023

Creating a workflow from scratch is a monolithically complicated thing to do.

Steps 3 and 4 are easy to do in SR, but I strongly recommend that you don't go down the route of using SR to create workflows - you're looking at thousands of lines of code.  And for 5, don't try to replicate all the migration code you'd need to do.

Like Pana Florin Ionut likes this

Suggest an answer

Log in or Sign up to answer