Forums

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

Text manipulation on smart values are not working on a custom field

Gerardo Dalena
Contributor
November 30, 2023

Hello,

I'm struggling with something very stupid that I do not understand.

I have a custom field (select list single choice) that I need to manipulate with smart values in Automation for Jira. I'm running a test automation with manual trigger to check what the audit logs have received. The custom field is not empty in the issue, however any kind of manipulation gives me blank values. Here's some example:

{{issue.fields.customfield_10191}} -> AR0062

{{issue.fields.customfield_10191.lenght}} -> blank

{{issue.fields.customfield_10191.left(2)}} -> blank

{{issue.fields.customfield_10191.toString().left(2)}} ->blank

The automation is not editing the issue, is just making these manipulations in the audit logs. Even so, I think I have all the permissions to run these operations. Am I doing something wrong with the syntax?I believe I double checked te documentation multiple times without finding any error.

Thanks!

1 answer

1 accepted

3 votes
Answer accepted
Ste Wright
Community Champion
November 30, 2023

Hi @Gerardo Dalena 

What are you specifically trying to achieve using smart values?

Ste

Gerardo Dalena
Contributor
November 30, 2023

Hello @Ste Wright ,

I need to extract the first 2 characters of the value.

Thanks!

Ste Wright
Community Champion
November 30, 2023

Hi @Gerardo Dalena 

It's likely because the Select List field is being read based on the option IDs, rather than the name of each value.

You could use a variable to get around this:

  • Action: Create Variable
    • Name = SelectListText
    • Smart Value = {{issue.customfield_10191}}
  • Action: Log Action
    • Message = {{SelectListText.left(2)}}

Ste

Like Laurie Sciutti likes this
Gerardo Dalena
Contributor
November 30, 2023

Hi @Ste Wright 

your trick does work, thanx a lot!

Best regards,

Gerardo D.

Like Ste Wright likes this

Suggest an answer

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

Atlassian Community Events