I have a project in which we need to calculate the issue priority based on the selection of other custom fields. The field values for selection are in ASCII text, but I need to assign a numerical value to them and then average the custom fields together at the end.
This is probably easiest broken down into 2 parts. The first part would be assigning a "score" to a custom field based on selection. E.g.
Option | Description | Score
Selection | Score |
0 - None | 25 |
1 - Low | 50 |
2 - Medium | 75 |
3 - High | 100 |
These are required fields, so the user needs to select an option before the issue can be created.
Once the field is selected, I need to assign it a score. My understanding is that I could do this through automation using smart values to assign the appropriate value but am having difficulty creating that through the automation section of the project. (I'm only a project admin, so options are limited.
The second piece would be, once all the "scores" are assigned, to divide the score by a different number to arrive at the weighted arithmetic mean. Since I can weight the score in the smart value, I'm assuming this is a simple arithmetic operation after assigning score?
I did review other posts online and in this forum, but most of them used the JWA, which we do not have available in our instance/project.
For the first part, this can be created with Create Variable and Lookup Table automation.
When: Issue Created
Then: Create Variable
Variable name: enter whatever you want to call it (i put 'OptionDescription' for this example)
Smart value: this would be the custom field, it doesn't need the 'issue.' {{customfield_field.value}}
Find smart value for custom field here
And: Create lookup table
And: Edit issue fields
Select your custom field
add smart value: {{PriorityScore.get(OptionDescription)}}
For the second part, you can use the Smart Values Math Expressions here to divide the score by a different number to arrive at the weighted arithmetic mean
@Riley Sullivan - Thank you for the information! I'll test that in the environment and post results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the solution! The issue is working as described but the original values for the custom field are reverting to "None" after evaluation? I would assume this is something I missed, but here are the screen shots for the current configuration:
Here is the "create variable" automation:
Create lookup table:
Edit issue:
Edit comment to verify results (working):
The custom fields reset to "None" even though the customfield.value and smart values are listed correctly in the comments:
Any ideas or suggestions in how to keep the values for the customfield?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you lookup the type of field your custom field is? Text? Numeric?
Also, when you go into the audit log of this automation, does say it edited the field? It should say Issues edited successfully twice for the screenshot you provided.
One other idea to try, is to just try one lookup table per automation. Lookup tables is a newer feature, and I am pretty sure in the release article they mentioned that having multiple lookup tables might mess things up or not work. Maybe give that a try as well?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The edits are working, but I had to create a separate field to hold the smart value.
I'll also try creating separate automations for the various fields, but this issue has been "solved"!
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I could help out!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @David Bristol
Welcome to the Atlassian community.
Can you show us the automation you have constructed so far, and point out the part with which you are struggling?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have an automation to show as I've tried various different iterations without success.
I'm currently looking at creating a lookup table with static numeric values for the {{issue.customfield_field.value}} and then doing arithmetic based on that.
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.