Automation - Specify a valid value for Currency (SL) (customfield_10077) - JSON error

Karen Kelly
Contributor
January 9, 2023

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

 

2 answers

1 accepted

0 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2023

Hi @Karen Kelly 

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

Karen Kelly
Contributor
January 9, 2023

Hello @Alex Koxaras _Relational_ 

 

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

Like # people like this
0 votes
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2023

Hi @Karen Kelly 

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

Karen Kelly
Contributor
January 9, 2023

Hello, @Ste Wright 

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

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

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

 

Audit log:

Screenshot 2023-01-10 at 07.18.47.png

Karen Kelly
Contributor
January 9, 2023

@Ste Wright sorry found the error, needed to add .Name after currency attribute as Currency is also an object type

Like Ste Wright likes this
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2023

Hi @Karen Kelly 

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

Ste

Suggest an answer

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

Atlassian Community Events