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,456,480
Community Members
 
Community Events
176
Community Groups

REST endpoint redirected to error page- Cannot open URL: bundle://200.0:1/rest_CreateMultipleSubtask

Edited

I am using a REST endpoint and here is my code: and here are some screenshots 

as you can see I am redirected to an error page after I click on the button. Anyone knows what is wrong?

Capture2.PNGCapture1.PNGCapture.PNG

package CreateMultipleSubtasks

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

import groovy.json.JsonBuilder

import groovy.transform.BaseScript

import com.atlassian.jira.issue.Issue;

import javax.ws.rs.core.MultivaluedMap

import javax.ws.rs.core.Response

import com.atlassian.jira.component.ComponentAccessor

import com.onresolve.scriptrunner.runner.ScriptRunnerImpl

import com.atlassian.sal.api.ApplicationProperties

import com.atlassian.sal.api.UrlMode

import org.apache.log4j.Logger

import com.atlassian.jira.project.Project

import com.atlassian.jira.bc.project.component.ProjectComponent

import com.atlassian.jira.project.ProjectManager

@BaseScript CustomEndpointDelegate delegate

callSubTaskCreator(httpMethod: "GET", groups: ["jira-users"]) {

MultivaluedMap queryParams, String body ->

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

log.warn("I AM HERE MOUNA 1");

ConfigurationCreateMultipleSubtasks conf = new ConfigurationCreateMultipleSubtasks()

def subTaskCreatorHashMap= conf.getSubTaskCreatorHashMap()

String itracCreatemultiplesubtasksProjectCategoriesURL = subTaskCreatorHashMap["itracCreatemultiplesubtasksProjectCategoriesURL"];

def user = ComponentAccessor.jiraAuthenticationContext?.loggedInUser

Issue issue = ComponentAccessor.getIssueManager().getIssueObject(queryParams.getFirst("issueId") as Long)

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

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

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

 

}

1 answer

0 votes
Trudy Claspill Community Leader Nov 14, 2022

Hello @Mouna Hammoudi 

Where did you find documentation that told you this was a valid API endpoint? Please provide a link to that documentation.

I see you have posted several questions in the communities. Some you have tagged as Jira Server and others as Jira Cloud. This one is tagged as Jira Cloud. Can you please confirm that you are trying to execute this on a Jira Cloud environment? The URL in your images does not appear to match the standard format for a Jira Cloud environment.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS

Atlassian Community Events