# JSM to JSW: Internal project sync

**URL:** <https://community.exalate.com/t/jsm-to-jsw-internal-project-sync/5606>\
**Category:** General Questions\
**Tags:** usecase, cloud-jira, migrated\_question\
**Created:** [November 4, 2024, 8:16am UTC](https://community.exalate.com/t/jsm-to-jsw-internal-project-sync/5606 "2024-11-04T08:16:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:16am UTC](https://community.exalate.com/t/jsm-to-jsw-internal-project-sync/5606/1 "2024-11-04T08:16:08Z")

</div>

_Originally asked by George Smith on 11 October 2023 [(original question)](https://oldcommunity.exalate.com/questions/95584817)_

* * *

Sync between _ **JSM** _ and **JSW** - change the project in which the issue is synced, based on the _ **properties** _ of the request.

* * *

#### Comments:

> **Javier Pozuelo commented on 11 October 2023**
>
> > Hello George,
> 
> I’m a little bit confused, could you elaborate a bit more on what you are trying to do?
> 
> Thanks

> **Vojtěch Veselý commented on 12 October 2023**
>
> > My usecase is to access certain properties that the available classes which wrap the fields doesn’t have. For example field “Request Type” when returned from issue.“Request Type” has only a few properties when compared to the equivalent returned from Jira REST API.
> 
> issue.“Request Type”
> 
> ```auto
> [
> serviceDeskProjectKey:RQST, 
> class:class com.exalate.basic.domain.hubobject.v1.BasicHubVpOrigin,
> requestTypeKey:null, 
> serviceDeskProjectName:Standard Requests, 
> serviceDeskId:1, 
> representationValue:null, 
> requestTypeName:Other, 
> requestTypeId:166, 
> portalKey:null
> ]
> 
> ```
> 
> Jira REST API when returned as a field /rest/api/3/issue/:issueKeyOrId using postman (I subtracted some texts)
> 
> ```auto
> {
> "_links": {
> "jiraRest": "{subtracted}",
> "web": "{subtracted}",
> "self": "{subtracted}",
> "agent": "{subtracted}"
> },
> "requestType": {
> "_expands": [
> "field"
> ],
> "id": "166",
> "_links": {
> "self": "{subtracted}"
> },
> "name": "Other",
> "description": "{subtracted}",
> "helpText": "",
> "issueTypeId": "10003",
> "serviceDeskId": "1",
> "portalId": "1",
> "groupIds": [
> "30"
> ],
> "icon": {
> "id": "10593",
> "_links": {
> "iconUrls": {
> "48x48": "{subtracted}",
> "24x24": "{subtracted}",
> "16x16": "{subtracted}",
> "32x32": "{subtracted}"
> }
> }
> }
> },
> "currentStatus": {
> "status": "Waiting for support",
> "statusCategory": "INDETERMINATE",
> "statusDate": {
> "iso8601": "2023-10-09T13:24:33+0200",
> "jira": "2023-10-09T11:24:33.295+0000",
> "friendly": "Monday 1:24 PM",
> "epochMillis": 1696850673295
> }
> }
> }
> 
> ```
> 
> You can also retrieve the data about request type from servicedesk API.
> 
> The main issue is that the httpClient doesn’t return the same values. The same field returned using httpClient looks like this:
> 
> ```auto
> [
> _links: [
> jiraRest:{subtracted}, 
> web:{subtracted}, 
> self:{subtracted}, 
> agent:{subtracted}
> ], 
> requestType:[
> name:Other, 
> groupIds:[], 
> description:{subtracted}, 
> icon:[
> id:10593, 
> _links:[
> iconUrls: {
> "48x48":"{subtracted}",
> "24x24":"{subtracted}",
> "16x16":"{subtracted}",
> "32x32":"{subtracted}" }
> ]
> ], 
> portalId:1, 
> issueTypeId:10003, 
> helpText:, 
> id:166, 
> serviceDeskId:1, 
> _expands:[], 
> _links: [self: {subtracted}]
> ], 
> currentStatus: [
> status:Waiting for support, 
> statusCategory:INDETERMINATE, 
> statusDate: [ 
> iso8601:2023-10-09T11:24:33+0000, 
> jira:2023-10-09T11:24:33.295+0000, 
> friendly:Monday 11:24 AM, 
> epochMillis:1696850673295
> ]
> ]
> ]
> 
> ```
> 
> For my usecase the required property is “groupdIds” in requestType.groupIds. As you can see the returned value from httpClient is empty but from the REST API it has a value. I don’t know why but the URL request is the same. Also the requestType.\_expands property is empty.
> 
> The servicedesk api  
> /rest/servicedeskapi/servicedesk/:serviceDeskId/requesttype/:requestTypeId
> 
> has the same issue, groupIds are empty.

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:16am UTC](https://community.exalate.com/t/jsm-to-jsw-internal-project-sync/5606/2 "2024-11-04T08:16:09Z")

</div>

_Answer by Javier Pozuelo on 28 November 2023_

Hello,

Unfortunately, due to Jira Cloud limitations, automatically moving issues is not applicable.

You can still synchronize in different project with a single connection, but this can be done only when an issue is created on the destination side for the first time using the “Exalate” option.

For example: If the issue sent is of type **Bug** from the project\*\*SD,\*\*create an issue with the type **Test** in the project **Testers**. In other cases create an issue with the type of **Task** in the project **Developers**.

**Incoming Sync destination side**

```auto
if(firstSync){
if(replica.project.key == "SD" && replica.type.name == "Bug") {
2 issue.projectKey = "TESTERS"
3 issue.typeName = "Test" 
4 }
5 else{
6 issue.projectKey = "DEVELOPERS"
7 issue.typeName = "Task"
8 }
}

```

If you have several project and type names, you could do a project and type mapping.

Regards,

Javier

* * *
