Hi all together,
we are using Scriptrunner in our JIRA / JSD environment.
I implemented the functionality from this post: https://community.atlassian.com/t5/Jira-questions/auto-add-organization-on-creation-of-ticket/qaq-p/25440 It works perfectly fine.
I would now like to modify it a little bit. The idea is to only add two specific Organizations whenever a ticket is created. I am totally new to groovy and also my knowledge of Java is just little.
My idea is to loop the variable "organizationsToAdd" and if the value is like my needed organization the script should add it to the customfield.
Something like this:
for (int i = 0; i< organizationstoadd.length; i++){
if (organizationsToAdd[i].name == "org1" || organizationsToAdd[i].name == "org2" )continue
else delete organizationsToAdd[i]
}
My problem is now that I don't know what "organizationService.getOrganizations(currentUser, organizationsQuery)?.right()?.get()?.results" returns and how I can access it. Is it an array or a list?
Can you perhaps give me hint how I can find out what is returned by methods and stuff like this in general?
I tried log.debug() but it is not writing anything in log console of Scriptrunner.
I would be really really happy if you can help me a little bit
Many thanks and best regards
Hannah