Forums

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

How can you tell which class will return the needed object?

Artemy Matvienko
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.
January 30, 2018

Currently, I'm looking to get the Options object so that I can sort the options of a specific field. I have the field config id, but, at a glance, there doesn't seem to be a way to generate the object from that id.

So, my more general question is: how can you tell which class will return the needed object?

I'm aware of the existence of the API documentation, but it just gives the list of classes, making it hard to determine the chain of instantiations that is needed to get to the needed object being generated, such as Options.

There's got to be a simple way to quickly find a way to get the objects you need to perform your ultimate goal, right?

Or is this sort of very controlled "object-call-chain" design pattern used by Atlassian in their API means that the trade-off is that it's difficult to use? I'm just new to this sort of pattern and I'm wondering if I'm missing something obvious. Maybe there's a tutorial that exists which can help newbies like me get the hang of navigating this sort of pattern?

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
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.
January 30, 2018

The usual trick for me is to start with a manager class.  You are looking at the option class, which is an object you get when delving into select list style fields, so I'd start with optionsManager as the most likely place to have "find a list of options"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events