Hi,
have the following code in production:
if (issue.get("customfield_14203")==null || issue.get("customfield_10102") == null)
return null;
return (issue.get("customfield_14203") - issue.get("customfield_10102"));
and it works fine. it returns a number of days (ex 10; -2)
Instead of this, i need to return a text, based on the value as folloiwng:
“Overdue” if the result >=0.1
else “On Time”.
can you please give me some help?
tks
Antonio
Hi @Antonio Caeiro ,
two possibilities:
- you want to create a new Calculated Text field to show Overdue or On Time, based on the calculation. For that, you can use this formula:
if (issue.get("customfield_14203")==null || issue.get("customfield_10102") == null)
return null;
return (issue.get("customfield_14203") - issue.get("customfield_10102")) >= 0.1 ? "Overdue" : "On Time";
- you want to keep your Calculated Number field as is, but simply display the value as Overdue or On Time (while sorting, searching, and exports will still be based on numbers). In that case, you can use the "Velocity Template" and "List View Velocity Template" configuration options with that code:
#if ($value >= 0.1)
Overdue
#else
On Time
#end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.