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

Cannot find method error - groovy (getProjectRoleActors

Daniel Burke Jan 11, 2018

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
Alexey Matveev [cPrime] Community Leader Jan 11, 2018

Could you show the error message?

Daniel Burke Jan 11, 2018

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

Alexey Matveev [cPrime] Community Leader Jan 11, 2018

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

getProjectRoleActors(ProjectRole projectRole, Project project)

Daniel Burke Jan 11, 2018

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

Alexey Matveev [cPrime] Community Leader Jan 11, 2018

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

Daniel Burke Jan 11, 2018

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

Alexey Matveev [cPrime] Community Leader Jan 11, 2018

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.

Daniel Burke Jan 11, 2018

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

Alexey Matveev [cPrime] Community Leader Jan 11, 2018

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

Daniel Burke Jan 11, 2018

Duh, of course.. thank you! 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

838 views 0 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