Can you add a comment via API from another user?

We create a ticket on behalf of a customer, but, we’d also like the ability to add a comment on behalf of the customer, or as ourselves.

However, I see no raiseOnBehalfOf or commentOnBehalfOf fields.

Is it possible to add a comment as another user, assuming my authenticated user has enough permissions?

@dave3 yes, via user impersonation (https://developer.atlassian.com/cloud/jira/service-desk/user-impersonation-for-connect-apps/).

But to be more prescriptive, here’s a post from last year with an example of how to do it:

1 Like

Is there a mechanism that works via the REST api?

@dave3 - once you have that bearer/access token (follow the impersonation docs), you can make REST API calls from your backend app. Scroll down to the section titled Using an access token in a request in the doc page I posted above. All requests sent using that auth token will be made on behalf of the user.

I don’t think I’m being clear, or, I didn’t quite grok that response.

So, I can create a customer request using this api, and I can provide a raiseOnBehalfOf, and provide an email address: https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-post

But, our app may want to add a comment that the customer made on our app to jira, and we would want it to come from that same user. How can I do a commentOnBehalfOf for that comment?

Keep in mind, the user may or may not have existed when I created the issue - I pass in an email address to raiseOnBehalfOf, and if the user is not already on service desk, an account will be created for them.

Also, we do not do OAUTH, we use Basic Authentication with a generated token for our admin user. https://developer.atlassian.com/cloud/jira/service-desk/basic-auth-for-rest-apis/

So, I’m not sure how to impersonate using REST and Basic Authentication.

Hi @dave3,

I don’t think it is possible with normal Rest API.
There is an open feature request: https://jira.atlassian.com/browse/JRACLOUD-35124
Comment just does not work the same as create.

Cheers,
Andy