Is it possible to set a custom field based on Original Estimate?
For instance, I have a custom field called "Shirt Size" and if the Original Estimate is in the range of 0h - 1.75h then Shirt Size will automatically set to "XS" (xtra-small) if OE is in the range of 2h - 4.75h then Shirt Size will automatically set to "S" and so on so forth
"XS" => 0h - 1.75h
"S" => 2h - 4.75h
"M" => 5h - 7.75h
"L" => 9h - 11.75h
"XL" => 12h - 14.75h
else
null if greater than 15h
Is something like this possible?
Community moderators have prevented the ability to post new answers.
Yes, you could use a scripted field from Script Runner plugin to easily implement such a field. The script is something like this.
Long oe = issue.originalEstimate String result = null if (oe) { oe = oe/1000/60 // milliseconds to minutes } switch (oe) { case [0..105]: result = "XS"; break case [106..285]: result = "S"; break // ... } return result
I placed the script into the Calculated Text field and the field didn't show up on my create screen nor when I created the issue after filling out the Original Estimate.
Do you suppose I have to re-index?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A calculated text field seems to be another plugin, right? The script is for a scripted field from the Script Runner plugin.
Scripted fields doesn't show up on create or edit screens, only on view screens.
After the scripted field creation is complete you only need a reindex for existing issues (if they are affected). You could use the builtin reindexing script for this (or a background reindex). Newly created issues (or edited issues) should already hold the correct value for the scripted field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx Hennins and Jamie. Super implementation. //For others who like to get value of a custom field def extCost = getCustomFieldValue("customfield_15102") // this fails def extCost_ = getCustomFieldValue("External cost (EUR)") // this works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.