You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi there
We have a requirement to pass custom field values to an external application and our plan is to use the Webhook automation rule to support this.
I can't seem to get smart values to post as part of the JSON payload.
Any help appreciated.
Thanks
Andrea
.
Hi Andrea,
I see that you are trying to setup an automation rule in order to send a json payload, but this is not working as expected. From looking at your screenshot of the configuration, it looks like you're trying to setup a rule that will create a new request in a Jira Service Desk project.
Your json payload looks to be close, but you need to encapsulate the smart value in double quotes. You can see an example of the payload needed in the REST API example of POST /rest/servicedeskapi/request.
Try changing that one line to
"summary": "{{issue.customfield_10131}}"
In turn that should pass the value of that field on this issue into summary field, so long as that custom field is just a text field with some value. If this is a different kind of custom field, such as a select list, or cascade select list, you might find that the output looks a bit different here. And if this field has no value, you might find that the json payload is empty for that particular webhook.
I always like to use a service like https://postb.in/ when testing out my webhooks to make sure that the payload I expect I am sending is actually being received by the endpoint. It makes for a useful means to test out webhooks.
Andy
Thanks for your response Andy.
I'm still getting blank values when using the custom field smart value within the JSON.
As a workaround, I've added an action before the Send Web Request action, to post the custom field value as a comment.
I'm then using the "{{issue.comments.last.body}}" within the JSON, and this passes.
It does seem weird that the JSON isn't picking up the value from the custom field however.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not expecting that you would need to use the .value postfix like you have in your most recent screenshot here. That does not show the value the field has, but rather .value is documented in Smart values - general as showing a property value. Such property values are null by default, but could be used by apps/addons in Jira in order to store some kind of meta-data about the field/issue/project/etc.
I would try change your description from
"{{issue.customfield_10081.value}}"
to just
"{{issue.customfield_10081}}"
in order to show the current value that custom field has.
If that does not work as expected, instead of trying to identify the field by the unique 5 digit identifier, perhaps you could just use the name of the field for the smart value, such as
"{{issue.MyCustomFieldName}}"
And if that doesn't work as expected here, then I have a few questions for you to try to learn more here:
Try the first two alternatives above, and if that doesn't work, please let me know more.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andy
Neither of the suggestions appear to offer a solution unfortunately.
The two fields I have created for each scenario are text fields, so from everything I've read, they should be able to be used.
Project type is Classic.
Thanks
Andrea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestions, it worked for me. I am able to get the custom fields data
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have now been able to successfully post using smart value {{issue.MyCustomFieldName}} to various endpoints.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan. &nb...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.