Update: After some additional testing, it appears that the api user must be an admin to change the label and assign users. Is there any reason why that is?
Question:
I’m working with GitLab 12.5, and posting a new issue through the API works with the exception that labels
and assignee_ids
are ignored. I’m writing utility to migrate bugzilla bugs (with attachments) to GitLab. (side note: if you know of any way to set the author
of the issue and notes/comments please let me know. Right now the author for each issue/note is a utility account I’ve created to do this automation)
Here is my POST
body:
{
title: 'Verify entries',
description: '\n' +
'*Creation Date*: `2017-03-31T14:24:09Z` \n' +
'*Priority*: `Normal` \n' +
'*Severity*: `enhancement` \n',
labels: 'confirmed,enhancement,priority::medium',
created_at: '2017-03-31T14:24:09Z',
assignee_ids: [ '1' ]
}
I tried changing the type of those fields:
{
title: 'Verify entries',
description: '\n' +
'*Creation Date*: `2017-03-31T14:24:09Z` \n' +
'*Priority*: `Normal` \n' +
'*Severity*: `enhancement` \n',
labels: [ 'confirmed', 'enhancement', 'priority::medium' ],
created_at: '2017-03-31T14:24:09Z',
assignee_ids: [ 1 ]
}
I even tried moving the labels and ids to the url. Here is the entire require that’s being sent through the node library request-promise-native
:
{
method: 'POST',
uri: 'http://myaddress/api/v4/projects/2/issues?labels=confirmed,priority::medium,enhancement&assignee_ids=1',
body: {
title: 'Verify entries',
description: '\n' +
'*Creation Date*: `2017-03-31T14:24:09Z` \n' +
'*Priority*: `Normal` \n' +
'*Severity*: `enhancement` \n',
created_at: '2017-03-31T14:24:09Z'
},
json: true,
headers: { 'PRIVATE-TOKEN': 'removed' }
}
I verified that the labels and user id do exist. Any thoughts?