Passing the "Labels" field in a Webhook

Mark Van Loock March 11, 2024

I'm a ServiceNow developer, and we now have ServiceNow creating Stories /  Issues in Jira. It is inserting the ServiceNow ticket reference number into the "Label" field.

Looking in Jira, the "labels" field is visible under the Details section when I open the story / issue.

I have created a Webhook back to ServiceNow, so that when the story / issue is closed, it passes back the details. I can see many fields under Issue and Project, but I am not getting the Label field back.

I've searched but can not find a solution. 

Any pointers greatly appreciated.

2 answers

0 votes
Mark Van Loock March 19, 2024

Hi,

I found a workaround which may be helpful to others. Basically I've accepted that I need to work with the Jira reference number rather than the ServiceNow ref.

I was hoping for Jira to return the label that may or may not contain a ServiceNow reference number, then on the ServiceNow side I would process that IF a reference number is presented.

Instead Jira is returning its Jira ID / Key ref. I'm then searching ServiceNow to see if that matches any open ticket where I've stored the Jira ref and if there's a match then process it.

There is more searching required on the ServiceNow side, but the load is light so I'll get away with it for now!

Thank you for your help.

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2024

Hi @Mark Van Loock -- Welcome to the Atlassian Community!

How are you getting the issue information to send to ServiceNow: outgoing webhook configured from Jira admin functions, automation rule, app calling the REST API functions, etc.?  Knowing that may help the community to offer better suggestions.  Thanks!

Kind regards,
Bill

Mark Van Loock March 11, 2024

Hi,

I'm going through Settings > System > Advanced > Webhooks

I've followed this ServiceNow guide - https://docs.servicenow.com/bundle/washingtondc-integrate-applications/page/administer/integrationhub-store-spokes/task/setup-jira302-webhooks.html

Kind Regards,

Mark.

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2024

Thanks for that information.  I suspect the labels field is sent as an array of values in the JSON as described here:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Labels

As a suggestion, labels are used for many things by teams, and so your ServiceNow ticket number could be tampered with in error in the Jira issue.  Perhaps consider using a specific custom field for the value instead, or an entity property (as those are not normally visible on the issue views to users).

Like Mark Van Loock likes this

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