How to ensure branch exists before allowing JIRA workflow transition?

Nenad Miksa October 3, 2017

Hello!

I am creating custom workflow for my organisation and would like to prevent moving issue from "Selected for Development" into "In progress" if there does not exist at least one branch for that issue. I've already created the trigger which automatically moves the task into "in progress" as soon as branch is created, but I would like to prevent developers to manually move the task into "in progress" if branch does not exist, however if it exists then I would like to allow manual movement. Is there something like "branch exists condition/validator"? I do not see something like that in my JIRA options, however similar use case is described in JIRA advanced workflow configuration documentation, so I guess something like this is possible.

1 answer

0 votes
Nenad Miksa October 3, 2017

For the time being, I've made a workaround:

- on transition from "selected for development" into "in progress" there is a condition that task must have previously been "in progress"

- when branch is created, trigger automatically moves the task to "in progress"

Thus, task can move into "in progress" first time only by creating a branch.

Nenad Miksa October 4, 2017

Unfortunately, this workaround does not work for cases when developer creates branch before task is moved in "selected for development" state. This can be further worked around by adding another transition with same trigger (from "backlog" to "in progress"), which cannot be performed manually, but this is a dirty hack and does not allow checking for required conditions.

A condition "branch exists" would be much better solution.

Nenad Miksa October 4, 2017

FYI, just adding validator that checks that "Development" field is empty does not do the job.

alexander_tzonkov October 29, 2021

@Nenad Miksa Did you have any further success here and if you can help me with providing a jql that can be implemented as automation or help with a validator to use - my case is that I would like to restrict ticket to be closed if "Development" has some value (branch, PR, etc.) and the Fix version is empty - this way I would guarantee that all PRs are marked in a Release.

Do you think that this is something you can help me with?

Nenad Miksa October 29, 2021

@alexander_tzonkov, unfortunately, no. In the meantime (i.e. last 4 years) we've relaxed our workflows and allowed the manual transition of tasks for everyone and expect our people to be honest when changing JIRA tasks states 😞

alexander_tzonkov October 29, 2021

Thanks @Nenad Miksa I am also going with this option. Thanks for the fast reply!

Suggest an answer

Log in or Sign up to answer