The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Having issues with a specific customFieldManager method call in Scriptrunner, ".findByName()"

Marty Roger
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2020

I have limited experience with programming, usually just enough to cannibalize scripts that are similar to what I'm working on to get what I need done. I've been trying to create a scripted field to display the value of custom fields from subtasks in the parent task. Using this page, I grabbed the import statements at the top and the line


def customField = ComponentAccessor.customFieldManager.getCustomFieldObjects(firstSubtask).findByName(customFieldName)


I've been doing my best to learn as I go, and for the most part hitting Ctrl + J to bring up the javadoc has been really helpful. However, I can't seem to find anything anywhere, be it google, here, or the adaptavist library, about "findByName()". I'm not quite sure how it works, and would really appreciate if someone could give me more information about where it comes from.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Ferenc Nagy [Midori]
January 25, 2021

It should be an additional feature by ScriptRunner. Maybe something like this?
https://en.wikipedia.org/wiki/Grails_(framework)#Methods