Hello-
I have an automation that creates a new issue when a webhook is triggered (the source of the webhook is another Jira instance).
I want to populate data only if it actually exists. For example, if the "location" custom field has a value, add that to the description. If not, add "not selected".
This is what I have in the description field:
{{#=}}IF({{webhookData.fields.customfield_11356.value.isNotEmpty()}},"{{webhookData.fields.customfield_11356.value}}",0){{/}}
Note that this works fine if I only want to return a number, but as soon as I have the value returned if true set to some sort of string, I get an error stating "Unable to parse expression IF(true,"Bettendorf",0): IF(true,"Bettendorf",0)"
I've tried adding double quotes, no quotes, escaped quotes. I can't seem to get this to work.
Any ideas?
Can you recreate your automation here:
?
And share the link to your rule, it will be easier to see what you did and try to help
I've tried to add it a few times but keep getting an error.
Here's what I'm trying to do. The field "customfield_11356" may or may not contain a value. I want to test to see if it has a value, and if so, to put that value in the description. If not, put "not selected".
In other words:
IF(field is not empty, <value of the field>, "not selected")
This DOES work if the <value if true> and <value if false> parameters are numbers. It does not seem to work with text.
Attached a screenshot in case that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey there Peter,
Sorry a bit late in here but the format for this would be:
{{if(webhookData.fields.customfield_11356.value.isNotEmpty(), webhookData.fields.customfield_11356.value, "None selected")}}
You might need to play around with webhookData.fields.customfield_11356.value.isNotEmpty() for it to return true / false as you expect, but that should work.
Cheers,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.