I want to get the current user using scriptrunner in jira cloud. I want to add in currentuser name in the comment of an issue. But I couldnot figure out how to do so with scriptrunner in jira cloud. I did try
But didnot have any luck with them.
Can someone please help?
This is a 7 year old post, if my time math is correct, but you may give the solution here a try while waiting on Addaptivist
https://community.atlassian.com/t5/Jira-questions/scriptrunner-cloud-currentuser/qaq-p/7910
Hi, @Kedar Kanel 👋
I moved your post here, to App Central. This is a better place for this.
That said, you may get to a faster resolution by reaching out to the scriptrunner support team directly:
https://the-adaptavist-group-support.atlassian.net/servicedesk/customer/port
Best,
-dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kedar Kanel , @Shawn Doyle - ReleaseTEAM is absolutely right..
When you run the listener/script - use Current User. If you use SR add-on, then it will show as SR add-on.....
so try:
def response = get('/rest/api/3/myself')
.header('Content-Type', 'application/json')
.asObject(Map)
assert response.status == 200
def currentUsername = response.body.displayName
then use ${currentUsername} in the comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.