The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

ScriptRunner: Changing Reporter Leaves User as Anonymous

Marcelo Ulloa
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 Champions.
December 21, 2023

Good afternoon, currently, I have a ScriptRunner script in Jira Cloud that, every time an issue is created, changes the reporter. However, after making the change, the reporter remains anonymous. I have tried, but I cannot get the specified user to be reflected.

 

import org.slf4j.LoggerFactory

def logger = LoggerFactory.getLogger(this.class)


def updateResponse = put("/rest/api/2/issue/${issue.key}")
.header("Content-Type", "application/json")
.body([
fields: [
reporter: [
name: "ID-User"
]
]
])
.asString()

assert updateResponse.status == 204

logger.info("El ticket ${issue.key}. Se le actualizo el informador")

 Screenshot_1.png

 

Is there any way to use a script to change the reporter and have the specified user appear instead of remaining anonymous?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Giovanni Melai
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 Champions.
December 21, 2023

Hi @Marcelo Ulloa ,

it seems to be an issue with the body of the request, it should be something like this:

fields: {
reporter: {
id: "1234567890"
}
}

 I hope this helps

0 votes
Joseph Chung Yin
Community Champion
December 21, 2023

@Marcelo Ulloa -

Question for you, does the value you included in your "name: "ID-User" " pair an actual user (customer account" in your JSM site?

Please advise.

Lastly, take a look at this previous answered question posting in the community which it may assist with your issue - https://community.atlassian.com/t5/Jira-Software-questions/Scriptrunner-cannot-update-reporter/qaq-p/2519487

Hope this helps.

 Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events