How can i get or how must i set the variables to be available in a web-item url or in a raw xml? (Jira server)
Hi @Markus W_ BENES,
This is currently not possible, and we do have a Feature Request raised for this: SRJIRA-2360
As a workaround, you can have the Web Item execute a Custom Rest Endpoint by providing its relative URL in the Link field. Then, you can do any custom scripting in the endpoint code and redirect the user to a dynamic URL, similar to the following example: Web Item (Redirect)
As an example, here is my Web Item configuration:
And here is my Rest Endpoint script:
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegateimport groovy.transform.BaseScriptimport javax.ws.rs.core.MultivaluedMapimport javax.ws.rs.core.Responseimport java.net.URLEncoder@BaseScript CustomEndpointDelegate delegatedoSomething(httpMethod: "GET", groups: ["jira-administrators"]) { MultivaluedMap queryParams, String body -> def myVariable = "Hello World" def encodedString = URLEncoder.encode(myVariable) Response.temporaryRedirect(URI.create("https://www.google.com/search?q=${encodedString}")).build()}
Thank you for this piece of gold.
It looks like you're new here. Sign in or register to get started.