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

addActorsToProjectRole method is returning error on parameterizing the values with custom field

Edited

Hi,


Both of the scripts having same logs.warn, the only difference is one is with literal values and other having parameterized values from custom fields but Unable to add actor to project in the right side of the script, Leftside scripts works fine however right side with errors:

lieral and param.PNG

Error Says:

groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.bc.projectroles.DefaultProjectRoleService.addActorsToProjectRole() is applicable for argument types: (ArrayList, com.atlassian.jira.security.roles.ProjectRoleImpl, String...) values: [[smansoor], Contributor, Project: MQM, atlassian-user-role-actor, ...] Possible solutions: addActorsToProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, java.lang.String, com.atlassian.jira.util.ErrorCollection), addActorsToProjectRole(com.atlassian.jira.user.ApplicationUser, java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, java.lang.String, com.atlassian.jira.util.ErrorCollection) at Script601.run(Script601.groovy:50) ~[?:?]


Can someone identify the root cause, is it because the parameter or project in addActorsToProjectRole method is type of project?

 

Note: ("Jirakey" is an attribute of an asset object with type: Project & 14805 is insight customfield whose scope contains this asset object)


Thanks

1 answer

1 accepted

0 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 09, 2023

If you paste your full script it might help.

But from what I can see the main difference might be that in one, you use the project object and the other, the project key.

Convert your project key to a project object and see how it goes. Remove "toString()" at the end of line 38

@Peter-Dave Sheehan  amazing, thank you so much it worked

Suggest an answer

Log in or Sign up to answer