Syncing Closure of Jira User Story, ServiceNow RITM, and Task

I’m integrating Jira with ServiceNow and need help ensuring that when a User Story in Jira is closed, the related RITM and the associated ServiceNow Task also close automatically. I’ve tried some solutions, but they haven’t worked, so could you help me figure out how to make this happen?

To synchronize the closure of a Jira User Story (US) with a ServiceNow RITM and the associated Task, follow these steps:

  1. Outgoing Sync in Jira: Add a rule in Jira’s outgoing sync to ensure the User Story’s status is sent to ServiceNow when it is closed. You can set this rule as follows:
replica.status = issue.status 
  1. Incoming Sync in ServiceNow: Update the incoming sync rules in ServiceNow to handle the status change. When the User Story is closed in Jira, the RITM and Task in ServiceNow should also close. If you have an existing status mapping in your synchronization rules (refer to this documentation), add the “closed” status to the mapping. You can also directly set the status to “closed” in the script:
entity.setStatus("Closed")
  1. Optional Unexalation: If you need to unexalate the issue once it’s closed, you can use the following script:
if(replica.status == "Closed") {
  entity.setStatus("Closed")
  syncHelper.unExalateAfterProcessing()
  return new scala.Tuple2(issueKey, scala.collection.JavaConverters.asScalaBuffer(traces).toSeq())
}

This should synchronize the closure of the User Story, RITM, and the associated Task.

Hi Javier,

Thank you for the suggestion but thit did not work for me, it only close the RITM but not the task associated to it, I think that is maybe I am no fetching it, but can’t be sure, if you can help me giving me other way to do this it would be wonderfull

Hi,

Please find my inputs below

Within the ServiceNow Incoming Script, follow these steps to determine if the process is feasible:

  1. Verify Jira Issue Status
  • Check if the Jira issue status is set to “Closed”.
  1. Retrieve the Linked Task in ServiceNow
  • Use the ServiceNow REST API to perform a GET request.
  • Identify the associated task by retrieving the task number/sys_id linked to the request item.
  1. Update Task Status
  • Utilize GroovyHttpClient to execute a POST request that updates the task’s status to “Closed”.
  1. Close the Request Item via Exalate
  • Set the status of the request item using Exalate with the following command:
entity.state = "Closed"

While I am not entirely certain, this approach appears feasible based on the available integration methods. Let me know if further clarification or validation is needed.

1 Like