Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Choose/Add approvers based upon numeric field value

BillA March 26, 2018

I have a request for a project that will require approvals and I am trying to decide the best way to implement a certain requirement.   Essentially the project will be for contract and purchase requests and the approvers will be determined by the dollar amount of the request.  Basically the larger the amount the approvals will need to go hire up.  I could and might use separate issue types for each but was wondering if the appovers could be set dynamically based upon the value of a numeric field.  I'm thinking potentially script runner could do this.

2 answers

0 votes
David Willox March 26, 2018

Hi Bill,

Script runner would almost certainly work. An alternative would be to use a calculated text field available with JIRA Suite Utilities plugin. It used to be free, but now looks like it's upgraded to paid for, but it does come with a lot of useful features.

Using HTML script you can use the calculated field to set a predetermined text value based on numeric , text or date values from other fields.  For example;

<!-- @@Formula: if (issue.get("customfield_[x]") == null) return null;
Integer i = Integer.parseInt(issue.get("customfield_[x]"));
if (i==null) return null;
if (i>=100 && i<=500) return "[name]";
if (i>=600 && i<=1200) return "[name]";
return "[name]";
-->

0 votes
Payne
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 26, 2018

We have implemented a similar idea using JMWE conditions. We have 3 particular statuses/transitions in our workflow, each of which is conditionally used if a particular checkbox is checked. You may could do a similar thing based upon your value.

e.g. for one particular transition, you could have a condition like

return issue.get("The Numeric Field").value > 5000

so that if the field is > 5000, that transition is activated.


Hope that helps,
Payne

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events