Forums

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

Does JIRA API support user impersonation?

Artem Avramenko
Contributor
November 11, 2016

At the moment we use own tool that automatically saves working time of staff to Redmine, using User Impersonation

Does JIRA API allow to save spent time on behalf of other users?

2 answers

1 accepted

1 vote
Answer accepted
Stephen Deutsch
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.
November 11, 2016

The REST API does not directly support impersonation of users, but there is a plugin for that:

https://marketplace.atlassian.com/plugins/com.jirasudo.jira-sudo/server/overview

Please note that this would only work for JIRA Server.

0 votes
Nic Brough -Adaptavist-
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.
November 11, 2016

Which API?

Nic Brough -Adaptavist-
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.
November 11, 2016

For REST, then see Stephen's answer.

The Java API supports it, in the sense that you can write add-ons to do it.

Brian W. Bishop January 30, 2018

How about when using scriptrunner and groovy within a custom rest endpoint?

 

import com.atlassian.jira.component.ComponentAccessor

def jiraAuthenticationContext = ComponentAccessor.getJiraAuthenticationContext()
def originalUser = jiraAuthenticationContext.getLoggedInUser()

def userManager = ComponentAccessor.getUserManager()
def adminUser = userManager.getUserByName("deployer")
assert adminUser // make sure an admin user called "deployer" exists in all instances

try {
    jiraAuthenticationContext.setLoggedInUser(adminUser)

    // make REST requests here
}
finally {
    jiraAuthenticationContext.setLoggedInUser(originalUser)
}

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events