I am trying to create a JSM issue with Power Automate and then set values to a few fields in the issue. Creating the issue and setting component and a custom field value works fine. But I have not been able to set an assignee and a reporter.
The reporter gets set when the issue is created in the first step. The action Set reporter does not set the reporter field, but clears it to unassigned. The action Set assignee does not seem to do anything.
Can anyone point out what is the required input to update reporter and assignee?
@Eiríkur Baldur Þorsteinsson have you've been able to figure this out? :) Kær kveðja
Hey @Eiríkur Baldur Þorsteinsson ,
I did some testing on my end and the issue is your headers. Remove both of your headers and make the request without them. This is my entire request
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marcus Jones I removed the headers as you suggested and now I receive an error message saying "Client must be authenticated to access this resource." or “{"error":"Failed to parse Connect Session Auth Token"}“, depending on how I pass on the authorization/authentication.
I am authenticating via the same API token I use for the Jira connector in Power Automate, with which I successfully create and edit issues. The user to which the token belongs can create customers in the project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At the bottom of the HTTP action in power automate set your authentication to Basic. The "UserName" should be the Jira user that the API token was created under and the Password should be your API token itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I do this I get this error:
We would rather not give the user with the API token global administrator permission. It represents too much of a security risk in our view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I agree, unfortunately looking at the documentation that level of permission is required for that particular call. I haven't been able to find anything thus far on how that can be scoped down.
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.
Hi Marcus,
if the user can create a customer in JSM, it makes no sense to require admin permission in the HTTP call.
If this were the case then other HTTP calls like Get account ID, Create issue, Create customer request, Add comment to issue, Assign issue etc. should also require admin permission, which the don’t.
What needs to happen, for the permission for this HTTP call to change?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I agree 100% with you Eirikur, unfortunately from what I am seeing in the documentation, for that specific call you need those higher-level permissions. Is there a way you might be able to bulk import customers into your Jira instance? I know that is not a good way but could get you around this one call with those org level permissions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps someone smarter than me can provide additional insights, and if you find an alternative method, do let me know :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I learned that you can add an email instead of account id in raiseOnBehalfOf when using the Create customer request endpoint. If the customer does not already exist, it will be created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eiríkur Baldur Þorsteinsson
I've used that Power Automate connector and had the same issues. Since the connector uses the Jira Cloud API and not the Jira ServiceDesk API the reporter is always set to the user that generated the token you are using to authenticate. You will want to use the servicedesk api directly via HTTP calls and only then can you create a request on behalf of someone else. In terms of the assignee, I worked that out on the Jira automation side, but you could use the Jira ServiceDesk API to do the same. Happy to provide further assistance if you have questions!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marcus Jones ,
thank you for the reply.
I understand that I need to use the Jira ServiceDesk API directly via HTTP calls, instead of the Jira Cloud API Power Automate connector.
I see there is an HTTP call called "Add request participants" in Jira ServiceDesk API and one called "Assign issue" in Jira Cloud API. I cannot however find one for updating/replacing the reporter. Question 1: Isn't it possible to update reporter via HTTP call?
For the value raiseOnBehalfOf in call Create customer request and the array accountIds in call Add request participants, I need the account IDs of the users. At that stage I only have their email addresses. Question 2: How can I get a user's account ID if I only know it's email address? I am guessing that I would have to use the call Get customers, but I wouldn't know how to get an account ID matching the email address from the response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eiríkur Baldur Þorsteinsson , you are exactly right. The process will consist of actually several calls. The first call will be to get the user ID. That will be a simple HTTP request with the URL where you inject the user's email as part of the URL. This will return the user ID which you can then use in your next call to set the OnBehalfOf:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marcus Jones , thank you.
If the call Get Jira User ID returns empty, I guess next I need to create a customer in JSM using the call Create customer.
There I get an error message saying the JSON content is not valid. Can you please tell why?
Flow:
JSON input:
Error message:
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.
Hi @Eiríkur Baldur Þorsteinsson , Apologies for the delay, I took my family on vacation to the beach and have been disconnected. I will look further into this as I have time tomorrow, but just to confirm, the customer you are trying to create does not exist, right?
From first glance it appears your JSON is correct. Once I can do some testing on my end I should be able to provide a better response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries. Hope you had a lovely time at the beach.
That is correct. The customer I am trying to create does not yet exist.
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.