Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning smart value to a custom field based on selection

David Bristol June 26, 2023

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.

2 answers

1 accepted

0 votes
Answer accepted
Riley Sullivan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2023

Hi @David Bristol 

 

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

Screenshot 2023-06-27 at 4.07.50 PM.png

 

And: Edit issue fields

Select your custom field

add smart value: {{PriorityScore.get(OptionDescription)}}
Screenshot 2023-06-27 at 4.13.22 PM.png

 

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

David Bristol June 28, 2023

@Riley Sullivan - Thank you for the information! I'll test that in the environment and post results.

Like Riley Sullivan likes this
David Bristol June 29, 2023

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:

001-Create_variable.png

Create lookup table:

002-Create_lookup_table.png

Edit issue:

003-Edit_issue.png

Edit comment to verify results (working):

004-Comment_issue.png

The custom fields reset to "None" even though the customfield.value and smart values are listed correctly in the comments:

005-Customfield-None.png

Any ideas or suggestions in how to keep the values for the customfield?

Riley Sullivan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2023

@David Bristol 

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?

Like David Bristol likes this
David Bristol June 30, 2023

@Riley Sullivan 

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!

Like Riley Sullivan likes this
Riley Sullivan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2023

Glad I could help out!

0 votes
Trudy Claspill
Community Champion
June 26, 2023

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?

David Bristol June 26, 2023

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events