Within our Refinement process, I would like to store the current progress of Refinement in a Custom field, so the completion of Refinement for each issue can be shown and the overall progress of refinement can be displayed as graph. I am now at the point that I am using the following Smart values
{{#if(issue.fields.'API change'.isNotEmpty())}}1{{/}}+
{{#if(issue.fields.'DIS change'.isNotEmpty())}}1{{/}}+
{#if(issue.fields.'DoD'.isNotEmpty())}}1{{/}}+
{{#if(issue.fields.'Test plan'.isNotEmpty())}}1{{/}} +
{{#if(issue.fields.'Use Case 1'.isNotEmpty())}}1{{/}}
{{/=}}
I would expect any result between empty and 5
However, I only get ++++ as a result so
Later I added {{#=}} at the beginning and {{/=}} at the end, but then I get errors that it cannot calculate non-numeric values.
Then I added |0 to have the value 0 instead of null, like in this example
{{#if(issue.fields.'API change'.isNotEmpty())}}1|0{{/}}
However, the non-empty fields are still not counted.
Is there a way to accomplish this?
Hey Marc,
Are all of the fields number fields? If yes, I would set the default value for each field to 0. And then bulk change all existing values to 0 if they are empty.
Finally, and I don't know if it really makes a difference or not, but remove .fields. from the code for each field so that it is only:
{{#=}}{{issue.API change|0}}+{{issue.DIS change|0}}+{{issue.DOD|0}}+{{issue.Test plan|0}}+{{issue.Use Case|0}}{{/}}
or use the actual id of each field like:
{{#=}}{{issue.customfield_16712|0}}+{{issue.customfield_16713|0}}+{{issue.customfield_16714|0}}+{{issue.customfield_16715|0}}+{{issue.customfield_16757|0}}{{/}}
What do you mean by default value. Can you give an exact scenario?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Marc - please reply inline to this thread so that readers can follow the conversation.
So, in that case you could create a custom number field and then increment it by one each time one of those fields is update. And then you can add an IF condition at the end of the rule that checks if the value = 4 and then send the message or whatever needs to be done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John, with some help from Atlassian support I managed to create this calculation which now exactly does what I need:
{{#if(equals(customfield_10316.value,"Yes"))}}0.2{{/}}{{#if(equals(customfield_10316.value,"No"))}}0.2{{/}}{{#if(not(exists(customfield_10316.value)))}}0.0001{{/}}
+
{{#if(equals(customfield_10317.value,"Yes"))}}0.2{{/}}{{#if(equals(customfield_10317.value,"No"))}}0.2{{/}}{{#if(not(exists(customfield_10317.value)))}}0.0001{{/}}
+
{{#if(customfield_10335.isNotEmpty())}}0.2{{/}}{{#if(not(exists(customfield_10335)))}}0.0001{{/}}
+
{{#if(customfield_10168.isNotEmpty())}}0.2{{/}}{{#if(not(exists(customfield_10168)))}}0.0001{{/}}
+
{{#if(customfield_10043.isNotEmpty())}}0.2{{/}}{{#if(not(exists(customfield_10043)))}}0.0001{{/}}
I am using the 0.00001 value because 0 results in an empty result
I am using not exists because comparing with "None" is not possible
Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perfect! Thanks for updating the solution here with the code - that's fantastic!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Funk , here's the complete scenario:
Within Refinement of the issues a number of fields have to filled with content. It can take hours, days of even weeks to gather all the information and put it in the right place (fields). The fields that have to be filled are "API change", "DIS Change", "DoD", "Test plan" and "Use Case". The programme manager wants to know what the progress of refinement is, for each issue, but also for all issues that aren't done. So, if of these 5 fields, 4 fields are filled, we consider the refinement for that issue 4/5 = 80% done. To store the percentage of completion I created a new customfield and if any of the 5 fields is changed I would like to calculate the number of these 5 fields that contain information, other than the default value (null/None/Empty)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Funk thanks for answering. However, I don't want to add the values from those fields, but want to count the number of fields that have been filled with 'something' other than the default value. So, If 4 out of 5 fields are filled I would like to store 0,8 in the customfield Refinement Completion in order to be able to query on the progress of refinement. So basically counting the number of filled in fields.
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.