Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Correct json format for selecting device from the custom field(asset)

Soobin Kye
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 8, 2024

Hi everyone,

I'm working on setting up a webhook alert to create tickets on our customer service portal. When a device encounters a problem, it will send a webhook to Jira, which will then automatically generate a ticket. I can define some information in the webhook payload template (in JSON format), and I would like to incorporate a function that selects the alerting device from a custom field.

Since I have an object schema with assets, I've configured a custom field for it. Initially, I attempted to include the serial number of the alerting device like this:

"customfield_XXXXX": [ { "name": "{{deviceSerial}}" } ]

However, Jira ignored this field, leaving the custom field empty. On the other hand, when I used:

"customfield_XXXXX": [ { "objectId": "XXX" } ]

 successfully created a ticket with the alerting device selected in the custom field, as I directly specified the asset ID.

I'm looking for guidance on how to adjust the code so that I can update the custom field with the serial number or device name. Since we won't know in advance which device will trigger the alert, I can't simply use a fixed objectId. While I understand that automation is a great option, I would prefer to stick with API calls.

Thanks in advance!

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events