Hi Team,
I am working on an integration between Jira and ServiceNow to automatically create Time Cards in ServiceNow based on the hours logged in Jira.
When a user logs work hours in Jira:
I need the Jira Space/Project details when a worklog is created.
I noticed the following behavior:
When the following events occur, I can see the Jira Project/Space information in the payload:
When a Worklog Created event is triggered:
hi @Mohan Reddy
I believe this is common design limitation with default worklog_created webhook payload.Have you tried/considered the following options?
Extract the issuedetails from the worklog_created incoming payload.
Hi Mohan,
To make Viswanathan’s REST lookup option concrete, you can retrieve the Jira project with a single issue lookup:
GET /rest/api/3/issue/{issueId}?fields=project
If your incoming payload contains worklog.issueId, substitute that value for {issueId}. The endpoint also accepts an issue key.
worklog.issueId
{issueId}
Read these properties from the response:
fields.project.id
fields.project.key
fields.project.name
You don’t need a second project lookup just to obtain those values. This is supported by the Jira Cloud Get issue API. The integration account needs Browse Projects permission and access through any applicable issue security restrictions.
Since your existing integration already creates the Jira project from ServiceNow, I’d save the relationship at that point:
Jira site + Jira project ID → ServiceNow project sys_id
When a worklog arrives, resolve its issue’s project ID through that mapping and use the resulting ServiceNow project reference in your Time Card processing.
I’d also retain the Jira worklog ID for reconciliation and later changes. For duplicate webhook deliveries, Jira provides X-Atlassian-Webhook-Identifier, which stays the same across retries within a site. Use the Jira site together with this identifier to deduplicate deliveries, so a retry does not add the same hours twice. Webhook retry documentation.
X-Atlassian-Webhook-Identifier
Adding one thing to Sergey's lookup answer: plan for the worklog lifecycle, not just creation. Users often edit or delete hours after logging them. If you only handle worklog_created, ServiceNow Time Cards drift from Jira. Subscribe to worklog_updated and worklog_deleted too, and use the stored Jira worklog ID to update or reverse the matching Time Card entry.
Two smaller points:
It looks like you're new here. Sign in or register to get started.