Forums

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

How to Get ServiceDeskManager Object

Jackson Farnsworth
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.
February 27, 2019

I need to grab the ServiceDeskManager in my plugin, but am unclear on how to get it. Normally I'd use component accessor, but it lacks a method for it, and it's "getComponentOfType" returns null when trying to get anything Service Desk related. What is the proper way to get an instance of this object in a custom plugin?

Extra info:
My Service Desk classes do resolve in the project, I've imported with 


import com.atlassian.servicedesk.internal.api.ServiceDeskManager;

 and that seems to work fine.

1 answer

1 accepted

0 votes
Answer accepted
Jackson Farnsworth
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.
February 27, 2019

A search of the Developer Community actually revealed what I needed (https://community.developer.atlassian.com/)

To import most Service Desk objects, don't use:

ServiceDeskObject sdObj = ComponentAccessor.getComponentOfType(ServiceDeskObject.class)

Rather, you need to use:

ServiceDeskObject sdObj = ComponentAccessor.getOSGiComponentInstanceOfType(ServiceDeskObject.class)

Suggest an answer

Log in or Sign up to answer