It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to access add-on epxpiration information with rest api

Hello All,

I need a way to retrieve information about add-ons/plugins we have installed in our jira instance with rest api. If someone has such expirience or can address me to relevant documentation I will appriciate!

Thank you in advance

Eitan

1 answer

Hi Eitan,

The Adaptavist ScriptRunner plugin has a feature that allows you to create your own REST endpoints.

You can create a script that will return you the information you need and create your own endpoint to do the job:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.startup.PluginInfoProvider
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript

import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response

@BaseScript CustomEndpointDelegate delegate

plugins(httpMethod: "GET", groups: ["jira-administrators"]) { MultivaluedMap queryParams, String body ->

// Get a list of all of the plugins currently installed in this JIRA instance
def pluginInfoProvider = ComponentAccessor.getComponent(PluginInfoProvider)

def result = [
// ::.. You can uncomment this line to get the system plugins if you need them, maybe even parameterize it :-) ..::
//"systemPlugins" : pluginInfoProvider.getSystemPlugins(),
"userPlugins" : pluginInfoProvider.getUserPlugins()
]

return Response.ok(new JsonBuilder(result).toString()).build();
}


We have a documentation that will walk you through setting up your endpoint @ Custom REST Endpoint

You can find us in the Atlassian Marketplace

I hope that this helps you solve your issue!

Steve

Hi Eitan,

Did this resolve your issue? Are you still having issues with this??

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

1,097 views 7 0
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you