Automation - Specify a valid value for Currency (SL) (customfield_10077) - JSON error
Asked by Karen Kelly:

Hello,

I have a problem with the following code in JIRA Automation.

I have a field Currency (SL) / customfield_10077 which is a select list that I want to auto Populate with the value linked to the Instrument (IF) / customfield_10923 - attribute Currency

I get a Text field to update but not a Select list:

e.g.

Instrument (IF) is EAST.EY and the Currency = EGP

{  
"fields": {  
"customfield_10077": {  
"value": "{{issue.customfield_10923.get(0).Currency}}"  
}  
}  
}

This works

{  
"fields": {  
"customfield_10077": {  
"value": "EGP"  
}  
}  
}

But the value obviously needs to populate based on what the Asset Currency Attribute value is


Answers:
author: Alex Koxaras _Relational_
body: Hi [@Karen Kelly](/t5/user/viewprofilepage/user-id/1396766)

What does the issue.customfield_10923.get(0).Currency return? Can you place it in the audit log?

comments: author: Karen Kelly
body: Hello [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197)

O my goodness, thank you. it was returning the ID, so added .Name at the end and it is working!


author: Ste Wright
body: Hi [@Karen Kelly](/t5/user/viewprofilepage/user-id/1396766)

Just to confirm - for the select list...

1. Does the option you're trying to set *already exist*within the select list?
2. OR...are you trying to add a "new value" to the select list each time

If it's **(1)**, it should be possible to make this work. Could you share what the rest of the rule looks like? And provide some examples of the select list options?

If it's **(2)** , as far as I know this isn't possible using Automation. You *might*be able to do something using Web Requests, but it's not something I've seen done before.

Ste

comments: author: Karen Kelly
body: Hello, [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470)

I am looking at option 1.

The values are all already options in the Select list.

The Select List options are all currencies e.g.

![Screenshot 2023-01-10 at 07.15.07.png](https://community.atlassian.com/t5/image/serverpage/image-id/233606i76BC0F4A7A940FA6/image-size/large?v=v2&px=999 "Screenshot 2023-01-10 at 07.15.07.png")

Below is how the Instrument (IF) data is structured in Assets and displayed in the ticket. I am basically just trying to replicate the Currency Attribute in a field to use for something else. I can manually select the EGP option from the list or add it in the automation, but not get the value from this attribute to auto populate the select list.

![Screenshot 2023-01-10 at 07.11.00.png](https://community.atlassian.com/t5/image/serverpage/image-id/233604i9C3CB1A0BB3A145F/image-size/large?v=v2&px=999 "Screenshot 2023-01-10 at 07.11.00.png")

If I just try set a text field with this value it works though.

This is how the rule looks like

![Screenshot 2023-01-10 at 07.17.14.png](https://community.atlassian.com/t5/image/serverpage/image-id/233607i2440DDD8B5C0DEB4/image-size/large?v=v2&px=999 "Screenshot 2023-01-10 at 07.17.14.png")

Audit log:

![Screenshot 2023-01-10 at 07.18.47.png](https://community.atlassian.com/t5/image/serverpage/image-id/233608i32F429878129932F/image-size/large?v=v2&px=999 "Screenshot 2023-01-10 at 07.18.47.png")


author: Karen Kelly
body: [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) sorry found the error, needed to add .Name after currency attribute as Currency is also an object type


author: Ste Wright
body: Hi [@Karen Kelly](/t5/user/viewprofilepage/user-id/1396766)

**Edit:**Awesome, glad you found a way to do this :)

Ste


Tags: cloud

jira-service-management

jira-work-management-cloud