Jira Cloud to Jira Cloud: How to sync request types?

Hi,

We are trying to sync request types from one Jira Cloud instance to another, but we can’t seem to set it on the receiving side.

We can see in the Entity Sync that the request type is being sent, but it is not updated on the local entity:

Remote:
“customFields”: {
“Request type”: {
“id”: 10010,
“name”: “Request Type”,
“uid”: “10010”,
“type”: “VP_ORIGIN”,
“value”: {
“requestTypeId”: “28”,
“requestTypeName”: “General Incident”,
“serviceDeskId”: “2”,
“serviceDeskProjectName”: “Site B”,
“serviceDeskProjectKey”: “SITEB”
}
}
},

Local:
“customFields”: {
“Request Type”: {
“id”: 10010,
“name”: “Request Type”,
“uid”: “10010”,
“type”: “VP_ORIGIN”,
“value”: {
“requestTypeId”: “232”,
“requestTypeName”: “General Incident”,
“serviceDeskId”: “36”,
“serviceDeskProjectName”: “Site A”,
“serviceDeskProjectKey”: “SITEA”
}
}
},

We have the same name of the request type on both the remote site and the local site, but if we change it the sync is does not update the request type field.

We have tried following the following guide:

Any idea of what we can do to fix this?

Syncing the “Request Type” field between two Jira Cloud Service Management instances can be tricky because the request type is tightly linked to both the issue type and the service desk project. Here’s what you need to know and do:

  1. Outgoing Sync (Source Side):
    Make sure your outgoing sync script includes:

    replica.customFields."Request Type" = issue.customFields."Request Type"
    

    This ensures the request type info is sent to the destination.

  2. Incoming Sync (Destination Side):
    On the receiving side, you need to explicitly set the request type in your incoming sync script. Use:

    issue.customFields."Request Type".value = replica.customFields."Request Type"?.value
    

    This will set the local request type to match the incoming value.

  3. Important Notes:

    • The request type must exist and be valid for the issue type and service desk project on the destination side.
    • If the issue type or project doesn’t match, the request type won’t be set.
    • The custom field name might differ depending on your Jira configuration—double-check the exact field name in your instance.
  4. If It’s Still Not Working:

    • Confirm that the request type name and issue type are identical and valid on both sides.
    • Make sure the issue is being created with the correct issue type before setting the request type.
    • If you’re using Visual Mode, you’ll need to add a Script Rule to set the request type, as it’s not available in the standard field mapping UI. Example:
      if (firstSync) {
          sd.issue.customFields."Request Type".value = "General Incident"
      }
      

For more details, check out the official documentation:

If you follow these steps and ensure the request type, issue type, and project are all aligned, the sync should work as expected!

Can you share your current code please?

This needs to be outside of the if(firstSync) codeblock to work.

Kind regards,

Mathieu Lepoutre

Hi Mathieu,

Thanks for looking into this.

Please see the attached image for the code on both sides.

Best regards

Stian

Dear Stian

I had a deep dive into this.

The Request Type field in Jira Service Management cannot be updated on existing issues. This is a limitation of the Jira Cloud platform itself, not just Exalate. The Request Type can only be set when an issue is first created through the Service Desk API. Jira Cloud does not expose an API to change it afterward.

A workaround is to use the httpClient (but there is no endpoint from atlassian out) or a text field where you store the Request Type.

Kind regards,

Mathieu Lepoutre

Thanks for the clarification, Mathieu.

We do have the need to change the request type from time to time, so we will look into a workaround for this. Perhaps by syncing a custom field called “Remote Request Type” and an automation rule to perform the actual changing of the request type based on that.

Best regards

Stian

Hi Stian,

Although I am not 100% sure what I am suggesting here would work 100% but it’s still worth a shot.

What Mathieu (my colleague) suggested above is what I think as well, and changing the Request Type after the issue creation is a limitation and the only way out here would be httpClient().

Here’s an example for you which you can try.

if(firstSync){
    issue.projectKey   = "DEMO"
   // Set type name from source issue, if not found set a default
   issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
   issue.summary      = replica.summary
   store(issue) 
}


// We do a store(issue) so the issue.key will be created on the first sync and the request type will be set
// Note that customfield_10010 is the request type field and 33 is the request type id

def url = "/rest/api/3/issue/${issue.key}/"
def data = "{\"fields\": {\"customfield_10010\": \"33\"}}"
httpClient.put(url, data)

Let me know how it goes!

Thanks, Dhiren

Hi Dhiren,

Thanks for providing the API call.

We have tested this with a mapping of “remote request type name” to “local request type id”, and this works to both store the request type upon creating the ticket and when updating the request type .

Best regards

Stian

Hi @Stian ,

Great to hear, it works for you.

Thanks, Dhiren