Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
4,458,307
Community Members
 
Community Events
176
Community Groups

REST endpoint works as in line script but not as file, Cannot open URL: bundle://200.0:1/rest_Create

Edited
I am using this REST endpoint for a fragment and it works perfectly as an inline script. 
Capture.PNG
Here is my code below and here is a screenshot of the page where I am redirected after clicking on the button. 
Capture1.PNG

import groovy.transform.BaseScript

import com.atlassian.jira.issue.Issue;

import javax.ws.rs.core.Response

import org.apache.log4j.Logger

import groovy.transform.BaseScript

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate

import javax.ws.rs.core.MultivaluedMap

import com.atlassian.jira.component.ComponentAccessor

import javax.ws.rs.core.Response

import CreateMultipleSubtasks.Configuration_CreateMultipleSubtasks

import com.atlassian.jira.project.Project

@BaseScript CustomEndpointDelegate delegate

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

def log1 = Logger.getLogger("atlassian-jira.log")

log1.warn("MOUNA CAMELIA223");

Configuration_CreateMultipleSubtasks conf =new Configuration_CreateMultipleSubtasks()

def MultipleSubtasksHashMap= conf.getSubTaskCreatorHashMap()

String itracCreatemultiplesubtasksProjectCategoriesURL = MultipleSubtasksHashMap["itracCreatemultiplesubtasksProjectCategoriesURL"] as String;

log1.warn("MOUNA CAMELIA223 "+itracCreatemultiplesubtasksProjectCategoriesURL);

 def user = ComponentAccessor.jiraAuthenticationContext?.loggedInUser

  def issueId = queryParams.getFirst("issueId") as Long

  Issue myissue = ComponentAccessor.getIssueManager().getIssueObject(issueId)

  def issueKey = myissue.getKey()

  def itracCreatemultiplesubtasksProjectCategoriesURL2 = itracCreatemultiplesubtasksProjectCategoriesURL.replaceAll(":1:", issueKey)

  def itracCreatemultiplesubtasksProjectCategoriesURL3 = itracCreatemultiplesubtasksProjectCategoriesURL2.replaceAll(":2:", user.getUsername())

  log1.warn("The rest endpoint has been executed by the user " +user)

  Response.temporaryRedirect(URI.create(itracCreatemultiplesubtasksProjectCategoriesURL3)).build()

 

}

When I specify a file for the code that I refer to in my script editor. Everything fails when I click on the button and I am redirected to an error page as you can see below. 

Capture3.PNG
anyone knows what the problem is?
Capture2.PNG
Capture4.PNG

1 answer

did you get an answer for this?

 

I am having the same problem.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events