I want to create a workflow validator which will not allow the reporter of the issue to execute certain steps from the workflow. For that purpose somehow I have to get the User object or the user id of the user executing the action. How can I do that?
Get the current user inside jira workflow validator
705 views Asked by Svetlin Zarev At
2
There are 2 answers
6
Svetlin Zarev
On
Here is how I've managed to do it:
private String getCurrentIssueProcessorId(Map<?, ?> transientVars, Map<?, ?> args){
String processorId = (String) args.get(ARG_USER_NAME);
if(null == processorId || processorId.isEmpty()){
WorkflowContext workflowContext = (WorkflowContext) transientVars.get(ARG_CONTEXT);
processorId = workflowContext.getCaller();
}
if(logger.isDebugEnabled()){
logger.debug("Issue processor: " + processorId);
}
return processorId;
}
where ARG_CONTEXT is the string context and ARG_USER_NAME is the string username
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in JIRA
- List of US under Epic with label
- DevOps Preference: Point Solutions or Single Platform?
- Jira helpdesk widget doesn't create an iframe when script is loaded dynamically
- JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1). Error while integrating Jira create_issue tool with llm
- How to integrate JIRA with AWS dynamodb service, If any story/task movement has been occured on jira dashabord it should reflect on the AWS dynamodb?
- Listens to a github issue comment event and returns the comment added
- Can I take a velocity figure for a Fix Version in eazyBI JIRA App and use it calculate the velocity of a subset Fix Version? e.g. beta 1, beta 2, etc
- How can I limit a user to only see one project in Jira
- Jira - two different lists in transition
- Trouble Accessing Host Alias in Smarty Template (Centreon)
- How can I attach a Parent Issue Name to a Subtask Name in Jira?
- Jira Notification Scheme so that current assignee is notified only if they belong to specific group
- Should I Create One Branch per Task or One Branch for the Entire User Story
- Can a testing management tool support automated testing?
- JIRA JQL ORDER BY Case Statement Search
Related Questions in JIRA-PLUGIN
- Can I take a velocity figure for a Fix Version in eazyBI JIRA App and use it calculate the velocity of a subset Fix Version? e.g. beta 1, beta 2, etc
- How can I export jira archived issue csv file using Java code
- structure.gantt a task that must be at certain time for a certain duration vs automatically scheduled tasks
- Jira search_issues error returns "project not identified"
- Configuration fields in JIRA gadget
- Error in jira plugin development. while running mvn install, even if atlas-mvn clean works fine
- Single sign-on to JIRA v9.5 server failed
- How to update TestrunExecutionStatus as PASS or FAIL in jira using Jira Rest Java Client (JRJC) library
- Spring Boot application for Atlassian security is not starting
- How can I conditionally hide a field in Issue Edit screen in Jira On Perm, like this video shows in Jira Cloud
- Jira cloud REST API - Set default value of system field
- What could be the problem on my Jira Cloud custom app?
- Script function failed on Automation for Jira rule:IllegalArgumentException: wrong number of arguments
- JIRA Historic Data with Structure Plugin
- how to get rate limit values in JIRA REST API of /rest/api/3/field
Related Questions in OPENSYMPHONY
- How to manipulate Prestashop 1.7.x currency exchange rate using a fixed variable?
- Display data containing accented character from string using utf-8 encoding in Java
- How to find memory leak with com.opensymphony.oscache on legacy java application
- Get the current user inside jira workflow validator
- OS Workflow Replacement
- Struts2 JSON Parameter Mystery
- Symphony CMS File Upload Fatal Error
- empty clickstreams in J2EE webapp - what is the cause?
- Setting StrutsSpringObjectFactory as my current ObjectFactory
- Struts ActionProxy: how to set a method?
- Simulating running an HTTP request on a Struts action
- XML Catalog is not seeing by project
- Integrating OSworkflow with Spring and Hibernate
- Is OSCache under development or it has been discontinued?
- Tracking down the caller of a method [called through an invocation]
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
inject the
JiraAuthenticationContextAnd then calljiraAuthenticationContext.getLoggedInUser();you can find the documentation about the JiraAuthenticationContext here: https://docs.atlassian.com/jira/5.0.1/com/atlassian/jira/security/JiraAuthenticationContext.html