Hi,
I am trying to use a smart value in the edit issues action within automations to use a dynamic variable as the field to update but I keep getting an error about the field not being valid.
Basically I want to loop through values and save an id from a webhook response into different custom fields.
I have tried three methods all without success:
1) Creating a lookup table
{ "fields": { "{{lookuptable.get(value)}}": "{{webResponse.data.body.id}}" } }
2) Assign to a variable locally within the automation
{ "fields": { "{{localvariable}}": "{{webResponse.data.body.id}}" } }
3) Assign it to a field in the issue
{ "fields": { "{{issue.temp}}": "{{webResponse.data.body.id}}" } }
Does anyone in the community know if this is even possible?
Many thanks in advance,
Rupert
Context is important for automation rules. For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
From what you describe, I believe you are trying to:
Based on data in a webhook response, update a variable list of custom fields using a JSON advanced edit expression.
If that is correct, I suspect this is possible and some key things would be:
Kind regards,
Bill
Hi Bill,
Sort of. I am looking to get the id from a webhook response and assign it to its corresponding variable. I am looping through a checklist. Here are a few screenshot that may or may not help!
Rather than expand on them all I will go through the first example as they are essentially doing the same thing with me just thinking of different ways to try and achieve the same thing!
So for the first one I have a lookup table for the custom fields
I then loop through the items in a check box list
I want to edit the custom field associated with say LGW if has been selected, with the response from the webhook but I get this error. It can't find the smart value.
but if I log it the value is correct
If I hardcode customfield_10959 in the edit issue JSON it works.
Does this help?
Many thanks,
Rupert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where is that log action: inside the branch?
Have you checked if there are any leading / trailing spaces around the return from the table get() results? You could add a trim() to confirm that is not the problem.
UPDATED:
I forgot that I had figured out this scenario before :^)
The rule editor for the JSON edit tries to interpret that expression just-in-time...and so that error is it trying to parse, left-to-right, and so it does not evaluate the smart value for your field name before validating it.
The work-around: create your entire JSON expression in a variable, let's call it varJson, and then use only that in the advanced edit:
{{varJson}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That worked!
Thank you so much Bill. I shall have to remember that little "feature"!
Thanks once again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy I really like your approach. When I tried it with Organizations-Field, I keep running into: Invalid organization ids specified., Specify a valid value for Organizations ID (customfield_10002)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.