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: 

ObjectBean.getName() is marked as deprecated - what is the alternative?

Milan B
June 12, 2023

In my IDE and in the Atlassian Java API Documentation (under https://docs.atlassian.com/assets/9.1.16/index.html?io/riada/insight/model/DocumentationPage.html ) I find the method com.riadalabs.jira.plugins.insight.services.model.ObjectBean.getName() marked as Deprecated, but I found no suggestion what to use instead. 

I know deprecated means it will still work for some time, but I would like to be pro-active.

Does anyone know, how to replace ObjectBean.getName(), or where to search for that information?

Many thanks in advance.

 

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Evgenii
Community Champion
June 12, 2023

Hi, @Milan B 

Try getLabel(). It's not deprecated and result is same to getName()

Milan B
June 13, 2023

Thank you Evgeniy, it's working.

It's a bit confusing that getName actually does the same like getLabel, I can see now why they marked it as depricated :-) 

Like • Evgenii likes this
0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
June 12, 2023

Hi @Milan B

Could you please specify which version of Jira and ScriptRunner you are currently using?

For your case, I suggest upgrading your ScriptRunner plugin to the latest release, i.e. 8.4.0, and looking into the HAPI feature.

In HAPI, you will see a Work with Assets / Insight section. This is a more straightforward approach to invoking the Object Bean attributes.

I hope this helps to solve your question. :-)

Thank you and Kind regards,

Ram

Milan B
June 13, 2023

Thanks Ram, it's an interesting option for future code, yet replacing the existing getName with getLabel was easier for now.

TAGS
AUG Leaders

Atlassian Community Events