I have added a custom variable to the first step of my automation,
Smart Value of variable (which worked fine when I used it directly in the HTTP step):
postBody = {{issue.comments.last.body}}
When I try to use this variable {{postBody}} in the later Web Request step, I get nothing.
{
"jirakey":"{{issue.key}}"
,"statusid":"{{issue.status}}"
,"statuscode":"{{issue.status.name}}"
, "externalref":"{{issue.Ext Ref}}"
, "author":"{{issue.comments.last.author.emailAddress}}"
, "note":"{{postBody}}"
}
Example from Validate:
{ "jirakey": "SCM-227", "statusid": "10001", "statuscode": "Done", "externalref": "436976", "author": "xxx@yyyy.com", "note": "" }
Hello @Hugh Kelley
Can you show us the entire automation rule, please?
Sometimes problems like this are related to the context where the smart value is being referenced. The creation of the variable may be out of scope compared to where you are trying to use the variable.
I've uploaded pics. If there's a cleaner way to show it (JSON or XML) then I'm happy to learn that.
My issue seems similar to the one in Using-variables-in-functions-in-smart-values-in-JIRA where the variables don't seem to be usable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the issue is that the variable (from a previous step) is not set when the Send Web Request Validate option is used. If I add comments using a real issue, the variable seems to work as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you add a Log action to print the value of the variable to the rule audit log? Add it after creating the variable and before the web request step. This will confirm that the variable has a value.
Is there a reason you aren't using {{issue.comments.last.body}} in the web request?
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.