Hi, I have a question related to the Jira RESTAPI endpoint that allows me to get the metadata for creating issues of a given type in a give project. The endpoint is this (The API docs for the endpoint ):
/rest/api/3/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}
Making a request to this endpoint yields a response like this:
{
"fields": [
{
"fieldId": "assignee",
"hasDefaultValue": false,
"key": "assignee",
"name": "Assignee",
"operations": [ "set" ],
"required": true
}
],
"maxResults": 1,
"startAt": 0,
"total": 1
}As you can see we get 2 attributes fieldId and key, which always seem to have the same value.
Using the fieldId or key we can then make requests to create new work items or update an existing. For example to create a work item and set the assignee I would call POST /rest/api/3/issue with the following snippet in the payload
{
"fields": {
"assignee": {
"id": "5b109f2e9729b51b54dc274d"
}
}
} Question 1: which of these 2 attributes, fieldID or key should be used for making updates/creations of work items? I'm currently using key but I'm not sure this is the right way. Should we always use fieldId instead?