Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,507
Community Members
 
Community Events
184
Community Groups

groovy.lang.MissingMethodException: No signature of method: static com.atlassian.jira.user.util.User

Hi,

we have below Resolved By script filed code. 

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.user.util.UserManager;

def historyManager = ComponentAccessor.getChangeHistoryManager()
def userUtil = ComponentAccessor.getUserUtil()

def changeItems = historyManager.getAllChangeItems(issue).findAll { changeItem ->
changeItem.field == "status" && changeItem.toValues.find{ it.value == "Resolved"} && !(changeItem.fromValues.find{ it.value == "Resolved"})
}

def userid = changeItems.collect {UserManager.getUserByKey(it.userKey).name}
if(userid)
userid.last()

 

most of the time it is throughing below error while script field execution, could you please some one help on this issue.

 

2017-04-07 00:35:52,136 ERROR [customfield.GroovyCustomField]: Script field failed on issue: WM-107149, field: Resolved By
groovy.lang.MissingMethodException: No signature of method: static com.atlassian.jira.user.util.UserManager.getUserByKey() is applicable for argument types: (java.lang.String) values: [sokumari]
at Script4$_run_closure2.doCall(Script4.groovy:11)
at Script4.run(Script4.groovy:11)

1 answer

1 vote
JohnsonHoward
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.
Apr 10, 2017

Hi Ramaiah,

It looks like you are trying to reference a non-static symbol from a static context.

You will need to create a new UserManager object. i.e:

def userManager = ComponentAccessor.getUserManager()

Then call the getUserByKey() method on this object.

Regards,

Johnson Howard

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events