Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Products
  • Jira
  • Questions
  • We want the validator of the "Resolve Issue" transition to allow resolving an issue if and only if ("Remaining Estimate" == 0) OR ("Time Spent" > 0).

We want the validator of the "Resolve Issue" transition to allow resolving an issue if and only if ("Remaining Estimate" == 0) OR ("Time Spent" > 0).

l
Contributor
August 4, 2014

We want the validator of the "Resolve Issue" transition to allow resolving an issue if and only if ("Remaining Estimate" == 0) OR ("Time Spent" > 0).
Currently the validator doesn't allow resolving the issue if "Time Spent" == 0 (no work was logged against the issue) but "Remaining Estimate" is zero. But it should according to the condition above.

used the below script as the validator .

import com.atlassian.jira.issue.IssueImpl.*

Long ts = issue.getTimeSpent()
Long re = issue.getEstimate()

if((ts > 0) || (re == 0))
return true
else
return false

But this script will not work if the original estimate field is not filled in the issue.

Please help us

1 answer

0 votes
Dave Theodore [Coyote Creek Consulting]
Community Champion
August 5, 2014

Try the Jira Workflow Toolbox Jira add-on. It supports aritmetic functions that you can use to do this sort of thing. You may need to calculate your value in a post-function on a previous transition and insert the value into a custom field, then point your condition at the custom field, though. You might also try using the Jira Misc Workflow Extensions add-on. It has a condition that can compare a field value against a string. You may be able to compare both fields and use the built in "any"/"all" conditions functionality to do the logic for you. I frequently use both of these add-ons to do this type of thing for clients. I'm sure one of those add-ons will do what you want.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events