I am trying to get metadata for issues to use for creating issues programmatically. For fields, it seems a good approach is to use /rest/api/latest/issue/<IssueID>/editmeta to get the field options.
However, for one field is it an entity list. The field has the autoCompleteUrl as "https://.../rest/service-registry-api/service?query=". I can use this, but it only returns the top part list. How can I get all the values?
@Andy Macourek If your objective is to create issues programmatically, you should use the Issue Create Metadata API to retrieve all available fields along with their allowed options. Currently, you're using the editmeta resource, which only provides information about fields available after an issue has been created.
To get the create metadata, you can use the following API endpoint:
/rest/api/3/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}
To address your original question, could you please share more details about the field you're trying to populate? Specifically, we’d like to know the field’s name, its schema type, and whether it’s a system or custom field. If possible, providing a screenshot or a sample JSON response containing the field would be very helpful.
That helps quite a bit for the fields. Now, what I am looking for is how to get a list of entities. The field in question is thus:
{
"required": false,
"schema": {
"type": "array",
"items": "service-entity-field",
"custom": "com.atlassian.jira.plugins.service-entity:service-entity-field-cftype",
"customId": 10040
},
"name": "Affected services",
"key": "customfield_10040",
"autoCompleteUrl": "https://XXXX.atlassian.net/rest/service-registry-api/service?query=",
"hasDefaultValue": false,
"operations": [
"set"
],
"fieldId": "customfield_10040"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andy Macourek Thank you for sharing the field details. It appears you're trying to populate the "Affected Services" field in your issue and are looking to retrieve a list of all available Services in your instance.
At this time, there is no public REST API available to fetch this information. However, Atlassian has an open suggestion regarding this, which you can track here:
https://jira.atlassian.com/browse/JSDCLOUD-10015
Currently, the only viable option is to use the autoCompleteURL
you mentioned earlier. If you know part of the service name, you can perform a keyword-based search like this:
/rest/service-registry-api/service?query=mobile
This will return the top 20 services matching the keyword “mobile” in their names. While the API appears to support pagination, its parameters are undocumented, as this endpoint is not officially public.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.