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.CustomEndpointDelegate
import groovy.transform.BaseScript
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
import java.net.URLEncoder
@BaseScript CustomEndpointDelegate delegate
doSomething(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()
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.