Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira automation - Can't create and assign a user as a reporter due to being inactive

Javier Eduardo Marín Fernández
Contributor
July 27, 2023

Hello,

We have a rule triggered by an incoming webhook which creates a ticket and if the reporter user (comes in a custom field in the webhook) does not exists it creates it and should set him as the reporter.
The problem is at this last step, the user gets created but in inactive state which causes to fail the step for setting it as the Issue Reporter.

Captura desde 2023-07-27 12-11-49.png

2023-07-27_12-53.png

Although the "Edit issue" action shows "Issue edited successfully", the Reporter field is not populated with the created user, instead we get "Anonymous" in that field.

The weird thing is, we can access the issue and set the created user as a reporter if done by hand, but not in automation. But we need it to be set automatically.

 

Thanks in advance for your help.

2 answers

1 accepted

1 vote
Answer accepted
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 27, 2023

Hi @Javier Eduardo Marín Fernández and @Jack Brickey 

I think the webhook call triggers the create user action.

As I see this is a new request in a JSM project the created user should be a "Customer" in JSM terminology

Am I correct on my assumption @Javier Eduardo Marín Fernández ?

I think due to the settings in Atlassian Administration, the user doesn't get license (so inactive). This is a good thing, otherwise the user would probably be granted a JSM license.

I found this in the Webhook documentation, in the section: Executing a webhook:

  • The user includes an accountType field that is used to distinguish different types of users, such as normal users (atlassian), app users (app), and Jira Service Management customers (customer).

Might it be related to this?

Javier Eduardo Marín Fernández
Contributor
July 30, 2023

Hello @Marc - Devoteam

This is the action used for the user creation:

Captura desde 2023-07-31 08-11-54.png

I checked the provided documentation but I'm still not sure how to add the user as "customer" type.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2023

Hi @Javier Eduardo Marín Fernández ,

Yes, but I think I might have found a solution.

On you automation,

  • First create the new customer.
  • Then Branch the rule
  • Use action "Create service request"

    And use option Customer crated by this rul

Screenshot 2023-07-31 at 09.00.46.png

Or

In you original rule

set the last edit action to:

Screenshot 2023-07-31 at 09.53.09.png

Javier Eduardo Marín Fernández
Contributor
July 31, 2023

Thanks for your reply @Marc - Devoteam

I've just tried this and this is what I get:

Captura desde 2023-07-31 09-36-53.png

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2023

Hi @Javier Eduardo Marín Fernández 

Rethinking, so you could have within a webhook that the customer already exist, because they made an issue before.

If we would use an If - Else

Screenshot 2023-07-31 at 09.48.47.png

Javier Eduardo Marín Fernández
Contributor
July 31, 2023

@Marc - Devoteam this would be nice, but how do I set the webhook customer data as the initiator?

I think the initiator right now would be me, who created the rule, am I correct?

 

Also, with this rule I get the following error:

Captura desde 2023-07-31 10-14-00.png

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 31, 2023

Hi @Javier Eduardo Marín Fernández 

I expect that the user who needs to be the reporter set in the payload of the webhook?

Screenshot 2023-07-31 at 10.43.41.png

Javier Eduardo Marín Fernández
Contributor
July 31, 2023

Found the issue based on your answers. Using the "Create Service Request" action instead of "Create Issue" does the trick, just that action will create the customer if needed.

Like Marc - Devoteam likes this
1 vote
Jack Brickey
Community Champion
July 27, 2023

Hi @Javier Eduardo Marín Fernández , welcome to the Community.

I have never attempted this but wonder if it is a a timing issue. I see you have re-fetch already in there. As a test, it would be interesting to see if setting the Reporter in a secondary rule would succeed. 

Jack Brickey
Community Champion
July 27, 2023

Also, could you share the specifics for the last component where you are setting the reporter?

Javier Eduardo Marín Fernández
Contributor
July 27, 2023

Hello @Jack Brickey

Thanks for your prompt reply. The last action would be set the field "Reporter" as the email of the created user, using the custom field from the payload of the incoming webhook as a smart value:
{{webhookData.customer.email}}

Jack Brickey
Community Champion
July 27, 2023

Can you add an audit log to inspect that smartvalue?

Suggest an answer

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

Atlassian Community Events