Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Updating assignee and reporter with Power Automate not working

Eiríkur Baldur Þorsteinsson April 3, 2024

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?

Set reporter - Inputs.pngSet assignee - Inputs.png

3 answers

0 votes
Kristín Þórsdóttir
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 10, 2024

@Eiríkur Baldur Þorsteinsson have you've been able to figure this out? :) Kær kveðja

0 votes
Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 11, 2024

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

{
    "uri""https://*sanitizeed_url*/rest/servicedeskapi/customer",
    "method""POST",
    "authentication": {
        "username""*sanitized_email",
        "password""*sanitized*",
        "type""Basic"
    },
    "body": {
        "displayName""Bobby Boolean",
        "email""*sanitized_email*"
    }
}
Eiríkur Baldur Þorsteinsson April 12, 2024

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.

Create Customer Error 2.pngCreate Customer Error 1.png

Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2024

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. Jira_API_PA.png

Eiríkur Baldur Þorsteinsson April 12, 2024

When I do this I get this error:

Skjámynd 2024-04-12 130526.png

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.

Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2024

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.Jira_GlobalPermissionsRequired.png

Eiríkur Baldur Þorsteinsson April 12, 2024

Thank you @Marcus Jones .

This is indeed very disappointing. Thank you for the assistance.

Eiríkur Baldur Þorsteinsson April 16, 2024

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?

Like Marcus Jones likes this
Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 16, 2024

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. 

GlobalPermissionsRequired.png

Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 16, 2024

Perhaps someone smarter than me can provide additional insights, and if you find an alternative method, do let me know :)

Eiríkur Baldur Þorsteinsson April 18, 2024

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.

Like Marcus Jones likes this
0 votes
Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2024

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!

Eiríkur Baldur Þorsteinsson April 4, 2024

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.

Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2024

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: 

GetUserID_Jira.png

Eiríkur Baldur Þorsteinsson April 5, 2024

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:

Create customer if not alreay exists.png

JSON input:

Create customer JSON input.png

Error message:

Create customer Error.png

Eiríkur Baldur Þorsteinsson April 8, 2024

Hi @Marcus Jones have you had an opportunity to look into the above?

Marcus Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

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.

Eiríkur Baldur Þorsteinsson April 8, 2024

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.

Eiríkur Baldur Þorsteinsson April 10, 2024

Hi @Marcus Jones any luck?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events