Originally asked by Vojtěch Veselý on 10 October 2023 (original question)
Hello there,
I need to get IDs of Groups to which Request from JSM belongs to. Typically from REST API I could just access the field “Request Type” which has the “groupIds” property. Below is an example how the “Request Type” field looks returned from a REST API.
{
"customfield_10010": {
"_links": {},
"requestType": {
"_expands": [
"field"
],
"id": "166",
"_links": {},
"name": "Other",
"description": "",
"helpText": "",
"issueTypeId": "10003",
"serviceDeskId": "1",
"portalId": "1",
"groupIds": [
"30"
],
"icon": {}
},
"currentStatus": {
"status": "Waiting for support",
"statusCategory": "INDETERMINATE",
"statusDate": {
"iso8601": "2023-10-09T11:24:33+0000",
"jira": "2023-10-09T11:24:33.295+0000",
"friendly": "Yesterday 11:24 AM",
"epochMillis": 1696850673295
}
}
}
}
As you can see to access groupIds I would just simply use path customfield_10010.requestType.groupIds.
How do I achieve that in the outgoing sync script? Tried:
issue.customFields.“Request Type”.requestType.groupIds
issue.customFields.“Request Type”.value.requestType.groupIds
issue.customFields.“Request Type”.value - this returned null/null for some reason even though the script ran on a Request
Thanks