Update Value based on Lookup Table Key referenced by Variable

Celina Kincaid November 15, 2024

We link our service desk tickets to our product tickets 

Our product tickets have a checkbox field called Clients.

I have the trigger working the way I want but it can't find the lookup value correctly.

Here is what I want to happen:

  • Read the project key from the linked issue.
  • Create a variable from the project key.
  • Use that variable value to reference the lookup table key, to then find the value to set on the Clients field.

 

 

{
"update": {
"Clients": [{ "add": {"value": "{{ClientRefAthroughM.get({{linkedproject}})"}}}}]
}
}

 

ClientRefAthroughM = lookup table name

linkedproject = variable

1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
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.
November 15, 2024

Hi @Celina Kincaid 

Once a smart value expression is inside a set of double-curly brackets, you do not need to add more.  There also appear to be some extra brackets in your expression.

For example:

{
"update": {
"Clients": [
{ "add": { "value": "{{ClientRefAthroughM.get(linkedproject)}}" } }
]

}
}

As a tip, when writing JSON expressions for rules, try first creating them in an editor which shows if the brackets, parentheses, etc. match up.  Once they do, copy-and-paste the expression into your rule for use and testing.

Kind regards,
Bill

Celina Kincaid November 18, 2024

Thank you Bill!!  That helped.  The automation is running but it's finding an empty value.

Can you peek at my attached files?  It's saying 

"PLAYG-65 (Option value '' is not valid (customfield_10097))"  

Not sure why it's just seeing a quote and not finding the CW from the criteria.Snip - Audit log - Automation - Jira - Google Chrome (7).pngSnip - Audit log - Automation - Jira - Google Chrome (8).png

 

Celina Kincaid November 18, 2024

I started adding log messages and could see where it was breaking. 

I figured this out.  I changed my variable to {{issue.key.substringBefore("-")}} to strip out the project. 

Thank you!!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events