I need to get current user in Jira.but i tried few ways but didn't get a solution.
Hello @Ramesh Lakshmanasamy
Did you mean get user in code of some plugins like Scriptrunner?
If you do, you can use
import com.atlassian.jira.component.ComponentAccessordef user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
If you write jira pluginyou need to import it directly
@ComponentImport JiraAuthenticationContext jiraAuthenticationContext
@Mark MarkovI tried above solution but getting null.
Where are you tryin to get current user?
inside class which has contain my businesslogic
Thanks @Mark Markov it's working fine.
How to get the user in a Jira Service that extended from AbstractService and running from Service Scheduler/Cron?
ComponentAssessor.getJiraAuthenticationContext().getLoggedInUser()
always return null.
Hi
How can we get " company name" value of current logged user of jira by using script
Does anyone know how to get this using Scriptrunner for Jira Cloud?
I found 'user' does this so that you can use user.accountId to compare against, but it doesn't seem to work in all contexts like post functions.
just paste this code to the console.
btw this script will just let you know that you are logged in
import com.atlassian.jira.component.ComponentAccessordef user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()return user
It looks like you're new here. Sign in or register to get started.