Hi All.
I have two projects. The first one is Product Discovery which has a field as a list with weights (every option contains some value). Second one is Software Project. I created automation rule with smart values to copy some field from PD project to Software. It works if PD field is numeric but does not work with field which is list of options with values. On the Product Discovery itself I can calculate this field and copy it to another field.
Any advice, please, on how to convert this field to a number? This field can contain more than one option. They all are summarized and copied to another field (on the PD project).
Help, please
@Bill Sheboy OK, I'm an idiot and completely missed out one step, the NULL variable. Sorry to waste your time. Thanks for all this amazing work!
Hi @James Smith
Did you mean to post your response in this thread or another one? Thanks!
Kind regards,
Bill
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
When the rule gets those values from the multiple select, custom field, they are text. To convert them to numeric values use the asNumber function.
For example, to get the value for one selection use:
{{issue.myCustomField.value.asNumber}}
You note the field is multiple selection, and so the specifics of how you are using the values will determine next steps. Showing your rule and explaining further will help.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy
Thanks.
I changed Smart value to {{issue.myCustomField.value.asNumber}} and now it does not fail. But, it returns Zero despite the weight of the chosen option is 47.
The first image shows type of field and weights of their options. It is a Product Discovery project, by the way. Rule should calculate those value and store to Software Project field.
Thanks, in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, this is a JPD project and you are trying to access the "weight" value which (I believe) is dynamically calculated across selected values for a set. Is that correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it's not dynamically calculated. it's set constantly but this is a list of options with weights.
The first goal was to get dynamically calculated value as it works on JPD but I couldn't do it. So I took this formula and focused on repeating this calculation from JPD fields and store to Software Project. I will be able to do it if I can convert field options (with weight) to number. So, this is the my task and this was a question
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shortly, I need a Smart value, like this {{issue.myCustomField.value.asNumber}} which returns 47, if 1st option is chosen (see first image). And it will return 83 (47 + 36) if the 1st and 2nd options is chosen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already checked:
{{destinationIssue.Key Customers.value.getValue().asNumber}}
{{destinationIssue.Key Customers.value.getValue}}
{{destinationIssue.Key Customers.value.getValue()}}
It didn't work. returns 1 as I make + 1. So, I suppose it is 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the how-to article linked below to find which smart values are supported by rules, I created a JPD multiple-select field with weighting: the weight values were not available to the rule. Only the selected values were available.
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
I recall helping someone with a similar JPD question a while ago, and the work-arounds were to either use a Lookup Table to get the weights or to use repeated text replacements (i.e., text value for the number value.) The problem is both the field and rule need to be kept in sync.
An example of the text replacement would be this:
Assume a field with values of "Red", "Green", and "Blue", with weights of 1, 5, 10, respectively. The total of selected weights would be this, using math operations:
{{#=}}0{{issue.myCustomField.value.join(" + ").value.replace("Red","1").replace("Green","5").replace("Blue","10")}}{{/}}
How this works:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bill Sheboy sorry for not answering a long time. I was stuck with some weird issues and then didn't have time.
At last, I did it the way you suggested. I works, it really works. thank you. Kudos to you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vadym Hrigorash -- Thanks for the follow-up and confirming this approach helped.
Please consider marking this solution as "answered"; that will help others with a similar need find answers more quickly.
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.