Automation To Update Reporter From Custom User Picker

Steve Priole May 26, 2021

Hi. Currently Jira Service Desk (I'm using cloud) does not have a feature to allow one customer to open a ticket for another customer.  I'm trying to create an automation rule to work around this. 

I've created a custom field (user picker) and added it but I'm newer to Jira and trying to figure out the syntax to get this to work. Here's some I've tried - I could use a hand as not having this feature is killing me and it doesn't look like Atlassian is adding it any time soon.

Both Attempts seem to work (well, it changes the Reporter field) but it's putting the reporter name as Anonymous vs the one I chose when I submitted the ticket (one of my test customer names/accounts).  

Any help would be greatly appreciated 1000 times over  ;)

TRY 1:

{
"fields": {
"reporter": "{{issue.customfield_10135}}"
}
}


TRY 2:

{
"fields": {
"reporter": {
"name": "{{issue.User Picker CF.name}}"
}
}
}

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
May 27, 2021

Hi @Steve Priole 

For user field updates with JSON and smart values, I believe you need to set the id attribute due to the GDPR changes, such as:

{
    "fields": {
        "assignee": { "id": "{{initiator.accountId}}" }
    }
}

Here is the documentation for that:

https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

Best regards,

Bill

Steve Priole May 27, 2021

@Bill Sheboy  I'll give that a try tonight but does there need to be anything in the code that calls back to the Custom "user picker (single user) I created in that statement?  Will that change the assignee or the reporter of the ticket? 

Bill Sheboy
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.
May 27, 2021

Steve, I was just pasting in the example from the documentation.  Please change to use the fields as you need to reporter and your custom field.  Thanks!

Steve Priole May 27, 2021

ahhh gotcha - sorry, need me some coffee ;)

Like Bill Sheboy likes this
Steve Priole May 27, 2021

Forgive me. It's not working and I'm sure I'm 100% the root cause

The custom field I used was 10135.  

{
"fields": {
"reporter": { "id": "{{customField=10135}}" }
}
}

Bill Sheboy
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.
May 27, 2021

Is that an equals sign in your JSON or a typo in the post, Steve?

Like Rabbit Stoddard likes this
Steve Priole May 27, 2021

It's a clear indication I don't know what I'm doing ;)

I was reviewing other posts and trying things I'd seen so definitely wasn't a typo.  It's my badge of ignorance ;)

Bill Sheboy
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.
May 27, 2021

For automation, the Log to audit log action is very helpful.  Try writing stuff to the audit log to see what happens and often it will throw an error for invalid JSON that might not otherwise show up.

Steve Priole May 27, 2021

yeah, the first two statements in my original post - the Audit log said it was successful, but it put Anonymous in the reporter field.  Much of the other stuff I've tried failed in the logs

The latest shows (Specify a valid value for reporter (reporter)) so I've clearly screwed it up worse  lol

Steve Priole May 27, 2021

Ahhh think I got it :)

Thanks so much for the help and direction!

Like # people like this
JayJuan Jones January 21, 2022

@Steve Priole so what logic did you use to fix it? I am having a similar issue :(

Like Adrian Arm likes this
0 votes
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 27, 2021

Hi @Steve Priole 

Haven't tried your use case but could you verify whether the user from the user picker have access to the project as customer?

Steve Priole May 27, 2021

@Fazila Ashraf  - The customer is one of my test accounts I use.  The account is listed under Customers.

Suggest an answer

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

Atlassian Community Events