REST API to Get Customer Request (Issue) by account ID participant

I am looking on REST API for “how to get customer request (issue)” querying by account id which is attached to the issue participant. I’ve looked around the documentation but found nothing could get issue by participant id. any help will very helpful.

Hello @Isa

There is no REST API endpoint in JSM that will get (find) issues based on participants.

You can only get, add or remove participants from a request.

Welcome to the Atlassian Developer Community, @Isa!

If you are open to using Jira REST APIs, you can try Search for issues using JQL REST API. You can do something like

GET /rest/api/2/search?jql=project%20=%20{projectName}%20and%20cf[{customId}]%20in%20({accountId})

The customId here is the numerical part of the custom field ID of Request participants; for example, if the ID is customfield_20984, the customId to be used in the JQL above is 20984.

Do let us know if this works for your use case.

Cheers,
Ian

1 Like

@iragudo That works, thanks
But what would be the best way to find the custom field id for the “participants” field in JSM (programmatically)?

Thanks for the confirmation, @sash011.

To get the custom field id, you can use Jira Cloud’s Get fields REST API. The response will give you something like

[
   ...
    {
        "id": "customfield_20984",
        "key": "customfield_20984",
        "name": "Request participants",
        "untranslatedName": "Request participants",
        "custom": true,
        "orderable": true,
        "navigable": true,
        "searchable": true,
        "clauseNames":
        [
            "cf[20984]",
            "Request participants"
        ],
        "schema":
        {
            "type": "array",
            "items": "user",
            "custom": "com.atlassian.servicedesk:sd-request-participants",
            "customId": 20984
        }
    },
    {
        "id": "customfield_10029",
        "key": "customfield_10029",
        "name": "Satisfaction",
        "untranslatedName": "Satisfaction",
        "custom": true,
        "orderable": true,
        "navigable": true,
        "searchable": true,
        "clauseNames":
        [
            "cf[10029]",
            "Satisfaction"
        ],
        "schema":
        {
            "type": "sd-feedback",
            "custom": "com.atlassian.servicedesk:sd-request-feedback",
            "customId": 10029
        }
    },
...
]

From here, search for the item with name Request participants to get hold of the custom field id.

Hope this helps.

Ian

1 Like

Thank you
I thought there is a “easier way”, but I understand - will use the “field configuration” REST API endpoint