You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
I'm setting up a Jira webhook to create Jira Issue from third party application (ie. Postman), everything is ok except for the multi-select field. The department field is not populating.
Webhook Call from Postman:
{
"data": {
"title": "hello 10 October Test",
"description": "hello .. this is the description",
"department": ["Ford", "BMW", "Fiat"]
}
}
From Jira webhook setup, I used the "More Options" and add the field:
{
"fields":
{ "customfield_10108": [{"value": {{webhookData.department}}}]
}
}
May I know if anyone can explain how can I implement this.
Thanks!
Bernard
Hi @Bernard Carpio -- Welcome to the Atlassian Community!
You are trying to create the JSON for a multi-select, custom field: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-select-custom-field
To make that easier you could use the asJsonObjectArray() function to populate the expression: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-json-functions/#asJsonObjectArray-keyName-
Kind regards,
Bill
Hi Bill,
I tried to use the asJsonObject() function but I can't save and publish the webhook. Here is the script:
{
"fields": {
"customfield_10107": [
{{#webhookData.application.asJsonObjectArray("value")}}
]
}
}
I have this error while publishing the webhook.
Error while parsing additional fields - Failed to close 'webhookData.application.asJsonObjectArray("value")' tag
Please take note #webhookData.application this field is coming from our third party application to save into our Jira.
Can help which I have missed out?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you use the function asJsonObjectArray() it returns most of the syntax needed, and so you do not need the brackets wrapping it.
And, you appear to have added an # for iteration but that is also handled by the function.
Please try this instead:
{
"fields": {
"customfield_10107": {{webhookData.application.asJsonObjectArray("value")}}
}
}
If that does not work, please add a write to the audit log (using the Log action) to learn what this contains:
Application data: {{webhookData.application}}
That will confirm if you are accessing the correct attribute(s) with the function.
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.