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

Syed Muhammad Umair Mansoor October 9, 2023

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
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.
October 9, 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

Syed Muhammad Umair Mansoor October 9, 2023

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

Suggest an answer

Log in or Sign up to answer