Skip to main content
Skip table of contents

Using OSLC Connect for Jira with Scriptrunner

Scriptrunner is a popular add-on in the Atlassian Jira ecosystem. It can be used for many applications with OSLC Connect for Jira. Since we are using standard Remote Links for storage ( Understanding OSLC Connect for Jira Link Storage ) It opens some interesting usages for teams. Including some of the following suggestions below.

Fast Searches

Jira does not normally index Remote Links. Scriptrunner has resolved this with its design and offers JQL functions that perform quickly.

Users can find the documentation → https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/issue-links

Of particular interest to us is the usage of linkedIssuesOfRemote. With this, we can perform searches such as the following. Note that understanding the structure of OSLC stored remote links can be useful for leveraging the full power of these features. You can find details on the following page Understanding OSLC Connect for Jira Link Storage

All issues with tracks requirement links.

CODE
issueFunction in linkedIssuesOfRemote("relationship", "tracks requirement")

Note, when searching for multiple link types, you can combine these statements with OR statements or use wildcards in the relationship name.

Searching based on a remote resource URL (for all issues related to a specific remote artifact)

CODE
issueFunction in linkedIssuesOfRemote("https://polar-21r1-brest.sodius.cloud/polarion/oslc/services/projects/drivepilot/workitems/DP-400")

Or find all Jira issues related to the “drivepilot” project (Since Polarion embeds the project key in the URL)

CODE
issueFunction in linkedIssuesOfRemote("https://polar-21r1-brest.sodius.cloud/polarion/oslc/services/projects/drivepilot/*")

All issues with OSLC links

CODE
issueFunction in linkedIssuesOfRemote("application type","com.sodius.oslc.app.jira")

All issues with OSLC Links to a specific OSLC Repository. For this, we want to use the Friend URL to search the links. In the following example, I am searching for remote links that target my DNG server.

CODE
issueFunction in linkedIssuesOfRemote("url","https://portland-elm.sodius.cloud/rm/*")

If you want to be extra sure that these are OSLC links, you can also make sure that these issues are using OSLC links in a more complex query.

CODE
issueFunction in linkedIssuesOfRemote("url","https://portland-elm.sodius.cloud/rm/*") AND issueFunction in linkedIssuesOfRemote("application type", "com.sodius.oslc.app.jira")

Scriptrunner is very useful and flexible for searching large repositories (2 Million Issues and larger).

Automation Scripts

Scriptrunner allows us to write scripts in Groovy. We have used this to enable teams to update their OSLC links. You have lots of possibilities but we have found large value in two scenarios.

  1. Native with ScriptRunner, we can update Remote Links. This has been important as we have migrated users from other OSLC tools to OSLC Connect for Jira.

  2. We have opened up some of our APIs so that you can utilize OSLC Connect for Jira services to navigate to remote resources and update, add, or remove content. This has been important on data loading and migration of existing datasets. Occasionally, some customers want to do some project “clean-up” of links and use Scriptrunner to automate this.

We have examples of this in our developer section. Scriptrunner Examples

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.