We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

ServiceNow Jira Spoke Webhook - "Cannot read property 'name' from undefined" while processing Jira

fshakaib
Tera Contributor

Hi Experts,

I am working on a ServiceNow Jira Spoke webhook integration using the OOTB webhook endpoint:

/api/sn_jira_spoke/jira_webhook_callbacks/wh_entry

 

We are using:

OOTB Jira Webhook endpoint
Custom Webhook Registry
Custom Decision Table
Custom Subflow
The webhook reaches the ServiceNow endpoint, but we receive the following error:

Cannot read property 'name' from undefined

 

The stack trace points to the OOTB Script Include used by the Jira Spoke while building the Decision Table inputs.

 

During debugging, we found that the following OOTB method directly accesses nested fields:

inputs['issue_type'] = issue.fields.issuetype.name;
inputs['project'] = issue.fields.project.name;

if (issue.fields.priority) {
inputs['issue_priority'] = issue.fields.priority.name;
}

if (issue.fields.status) {
inputs['issue_status'] = issue.fields.status.name;
}

 

The sample payload we received from the Jira documentation contains fields such as:

"priority": "Minor"

instead of

"priority": {
"name": "Minor"
}

and it does not include objects such as:

issue.fields.project
issue.fields.issuetype
issue.fields.status

 

When I send a payload containing nested objects like:

"project": {
"name": "Test Project"
},
"priority": {
"name": "Medium"
},
"issuetype": {
"name": "Bug"
},
"status": {
"name": "Resolved"
}

 

the webhook processing proceeds successfully.

 

My questions are:
Does the OOTB ServiceNow Jira Spoke require these nested objects (project.name, priority.name, status.name, issuetype.name) for all webhook events?
Is the payload shown in the Atlassian documentation only a sample, or does the actual Jira runtime webhook include these objects?
Has anyone faced a similar issue where the OOTB Jira Spoke parser throws "Cannot read property 'name' from undefined"?
Is there any supported way to make the OOTB webhook parser tolerant of missing fields, or is a custom webhook endpoint the recommended approach?
Any guidance would be appreciated.

Thanks!

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @fshakaib 

 

Can you try this solution once as per KB:KB2765446 JIRA Project connection was failing with an error "Cannot read property 'Epic' from undefi... 

 

Resolution

The error occurs because older server_version values are no longer supported by the Jira integration endpoints.

To resolve the issue:

  • Navigate to the Jira Connection record in ServiceNow.
  • Update the Server Version field to match the actual Jira server version in use.
  • Set the Server Version to 10 and save the record.
  • Re-run the Validate and Fix Mappings UI action from the Jira Project.

After updating the server version to a supported value, the Validate and Fix Mappings action works as expected without errors.

 

Also check: https://www.servicenow.com/community/servicenow-ai-platform-forum/getting-error-quot-cannot-read-pro...

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti