How to get the last viewed project (selected project) in groovy using scriptrunner?

Amro Hassaan
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 5, 2016

Any example on the subject request will help me understand how to do it using scriptrunner. Which classes do i need to use? 

 

Thanks

1 answer

1 accepted

1 vote
Answer accepted
Amro Hassaan
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 6, 2016

in the context of using scriptrunner this did the trick:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.Permissions
import com.atlassian.jira.user.UserProjectHistoryManager
def upm = ComponentAccessor.getComponent(UserProjectHistoryManager.class)
def p = upm.getCurrentProject(Permissions.BROWSE, ComponentAccessor.jiraAuthenticationContext.loggedInUser)
return p.name

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events