Forums

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

Get ServiceDesk link from issue via Server API?

Paul Tiseo
Contributor
June 6, 2018

I am writing a script for an escalation service using ScriptRunner. I'd like to get the link to a Service Desk request via the portal. IOW, I'd like to get the "X" for the issue key in "https://example.domain.com/servicedesk/customer/portal/x/key"

  • Is there a Service Desk API like the JIRA Server API? https://developer.atlassian.com/docs/ does not seem to indicate one like the REST counterpart?
  • How can I get the portal ID to recreate a link by hand for a given ticket?

1 answer

1 accepted

2 votes
Answer accepted
Alexey Matveev
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.
June 6, 2018

Hello,

There is the Service Desk Api. You can find some info here on how to use it in ScriptRunner:

https://scriptrunner.adaptavist.com/latest/jira/recipes/misc/jira-service-desk.html

You can find Java doc on the Service Desk Api here:

https://docs.atlassian.com/jira-servicedesk/3.9.1/

Have a look at the PortalService class in the documentation. I guess it returns what you need.

Paul Tiseo
Contributor
June 6, 2018

Thanks! How do you instantiate the various manager/service classes? Is there an equivalent of ComponentAccessor? I saw in your SC link that they created a ServiceDeskManager via @WithPlugin and @PluginModule annotations. IS that the normal way to do it?

Alexey Matveev
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.
June 6, 2018

You should use the WithPlugin annotation. You should find the required by you service/manager and inject it with the PluginModule annotation:

@PluginModule 

YourService

Suggest an answer

Log in or Sign up to answer