Originally asked by George Smith on 11 October 2023 (original question)
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”
[
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)
{
"_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:
[
_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.