Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get application user instead of delegating app user Groovy


I am trying to create a script that copies the value from a select list field, adds a suffix to it, and then creates a label with that string, upon issue creation. The post function is:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.issue.label.LabelManager
import com.atlassian.jira.issue.Issue;

def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()

def ScrumTeamObject = customFieldManager.getCustomFieldObject(12205)
def ScrumTeamValue = issue.getCustomFieldValue(ScrumTeamObject).toString()
ScrumTeamValue.replaceAll(" ","_")
def suffix = "_Team"
def labelToAdd = ScrumTeamValue + suffix

JiraAuthenticationContext authContext = ComponentAccessor.getJiraAuthenticationContext()
ApplicationUser user = authContext.getLoggedInUser()

LabelManager labelManager = ComponentAccessor.getComponent(LabelManager)

The error is :


2021-06-04 11:19:09,668 ERROR [workflow.AbstractScriptWorkflowFunction]: Workflow script has failed for user 'abc'. View here: https://jira-abc/secure/admin/workflows/ViewWorkflowTransition.jspa?workflowMode=live&workflowName=abc&descriptorTab=postfunctions&workflowTransition=1&highlight=1
groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.label.DefaultLabelManager.setLabels() is applicable for argument types: (com.atlassian.jira.user.DelegatingApplicationUser, null, String...) values: [MARAMA(JIRAUSER83105), null, Engineering_Team, false, false]
Possible solutions: setLabels(com.atlassian.jira.user.ApplicationUser, java.lang.Long, java.util.Set, boolean, boolean), setLabels(com.atlassian.jira.user.ApplicationUser, java.lang.Long, java.lang.Long, java.util.Set, boolean, boolean)


We are using crowd, Jira 8.5.3 . How do I get an application user so that I can set the labels?


Thank you!

1 answer

1 accepted

1 vote
Answer accepted

Labels needs to be a set, not a string

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

New cloud apps roundup - June 2021

Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...

494 views 6 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you