Forums

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

How can I add a workflow condition that prevents transition if work is logged?

Rob Horan
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.
March 30, 2022

I want a Cancel button that closes an issue and sets the resolution to canceled.  However, this can only be offered if no work is logged on an issue.

I see I can use Value Field on Log Work, but I have not figured out how to use this properly. 

I've tried = 0 as a string and a number, no good.

I've tried = (empty) as a string and a number, no good.

I know I have the correct field; I don't know how to configure the condition. I know this is the right field since I was able to get issues to fail the condition with Log Work = 0, but in that case, I was never able to get the transition to appear, even when there were no work logs. 

I am concerned that this is simply not a possibility:

https://community.atlassian.com/t5/Jira-Software-questions/Workflow-Condition-How-to-set-condition-for-field-Original/qaq-p/1400137

2 answers

0 votes
Igor Dugalic
Contributor
March 31, 2022

Hi Rob,

this should work:

Allow the transition to status "Cancel " only if the value of "Time Spent" is empty, with condition "=" and set as "Number"

TimeSpentNull.jpg

Edit: Updated my answer with the working solution.

0 votes
Benjamin
Community Champion
March 30, 2022

HI Rob,

You may need an add-on for this to extend the Current capabilities of the conditions. This may be less than ideal, but can use validator so when a user clicks on the cancel button, it will be rejected if there is time log.

 

There's was a similar situation but exactly in this post:

 

https://community.atlassian.com/t5/Jira-questions/How-to-use-workflow-validators-to-force-time-logging/qaq-p/824962

 

Thanks,

 

Ben

Suggest an answer

Log in or Sign up to answer