Cannot find method error - groovy (getProjectRoleActors

Does anybody else get this error when trying to use the getProjectRoleActors and passing in two arguments? Or am I being silly and missing something?

I'm trying to get the users who have each role in each project..

Thanks2018-01-11_13h36_57.png

1 answer

0 votes

Could you show the error message?

Sorry, here is the message and my imports that I have: 2018-01-11_13h36_57.pngimports.png

That is right. There is no such method. You pass wrong parameters. You should pass

getProjectRoleActors(ProjectRole projectRole, Project project)

I get the same error when I pass two arguments as string representations, ideally I'd be able to get the full list of roles, with the users (actors) too.

I also tried to pass in (projectRoleList[1], "Test") but still get the same error. Any ideas?2018-01-11_13h36_57.png

You should pass ProjectRole and Project variables. Not Strings, ints, long etc. String is String. String is not ProjectRole or Project.

2018-01-11_13h36_57.pngHmm, these are Project and Role objects though (I think) that are being passed in..

No, these ara List<ProjectRole> and List<Project>. And List<ProjectRole> does not equal to ProjectRole. Same with Project. You need to iterate over Lists and pass each value to the function.

Can you give me an example please? I'm confused.

for (ProjectRole projectrole : projectRoles) {

for (Project project : projectArray) {

  def ret = projectRoleManager.getProjectRoleActors(projectRole,project)

}

}

I did not check the code. There are can be typos. But it is the idea

Duh, of course.. thank you! 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Jira

Updates to jira.atlassian.com give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

319 views 1 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you