Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Access URL in customer portal

I have the following issue.

I'm trying to display a notice on the creation page of a case in the customer portal.

I try this with a Scriptrunner web panel


import com.atlassian.jira.plugin.webfragment.model.JiraHelper import com.atlassian.jira.component.ComponentAccessor import com.atlassian.servicedesk.api.requesttype.RequestTypeService import com.onresolve.scriptrunner.runner.customisers.WithPlugin @WithPlugin("com.atlassian.servicedesk") def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() def requestTypeService = ComponentAccessor.getOSGiComponentInstanceOfType(RequestTypeService) def query = requestTypeService.newQueryBuilder().serviceDesk(7).requestType(137).build() def reqT = requestTypeService.getRequestTypes(currentUser,query) def requestType = requestTypeService.getRequestTypes(currentUser, query).results def name = writer.write( '''<style> label#attachment-label.field-label::after { content: "MyText"; background-color:#fff7e0; color:black; font-family: Arial, Helvetica, sans-serif; } </style> ''' )


I want to resolve in this line requestTypeService.newQueryBuilder().serviceDesk(7).requestType(137).build() and set the serviceDesk and the requestType from the Url of the creation. But I can't access it. How can i get the url ?

1 answer

0 votes

You can access the request type directly from the binding variable "context".


So you can dispense with the query altogether

You can always examine what else might be available to you by outputting some details


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the s...

668 views 3 20
Read article

Atlassian Community Events