When a user doesn't have "Edit Issues" permission, but does have comment or attachment permissions, the comment/attachment field is not appearing in the editmeta of the GET /issue/{id}?expand=editmeta,schema,names
If the user has edit permissions, this method will allow me to determine if the user has comment permission.
Is there a reliable way to determine if the user has comment or attachment permissions in this call that doesn't depend on the other permissions the user has?
Details:
Jira version: 8.5.0
Hi,
I understand that you are using Jira Server, and looking to find out more about what permissions each user has to a particular issue. The endpoint of GET /rest/api/2/issue/{issueIdOrKey} can use the expand parameter to get the editmeta data. However that editmeta is only intended to show what you can edit as a user on that issue.
Technically a comment to an issue is not a field on the issue that can be edited. The comments are directly related to the issue, but they are not exactly an issue field. Also attachment is a special kind of field as well. But I can certainly see why you would want to be able to see those permissions from that REST API call.
Instead of using that endpoint, perhaps you could use GET /rest/api/2/mypermissions and specify the issueKey parameter when making that call. This can return to you permissions such as "ADD_COMMENT" and "CREATE_ATTACHMENT" which can then tell you if your account has the permissions to do so on that particular issue.
Does this help? Please let me know either way.
Andy
I was hoping to not have to make an additional call, but I can understand that determining these permissions wasn't the intended use of the GET /issue/(id} endpoint. Thank you for your help!
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.