Hi there,
I am trying to clone a project on Jira by connecting to the REST API via a python file. I have looked all over the internet and I have not really found what I am looking for. I wondered if anyone here could lend a hand and tell me if it is even possible. ps. if it helps I do have the scriptrunner plugin for Jira. TIA!
I have put these on my website is a clear form:
https://www.mos-eisley.dk/display/ATLASSIAN/Copy+a+Confluence+Space+with+Scriptrunner+REST
https://www.mos-eisley.dk/display/ATLASSIAN/Copy+a+Jira+Project+with+Scriptrunner+REST
Hi @Aaron Korb
Why not write your own code using ScriptRunner for Jira and use custom REST End points?
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx for replying. I am unfamiliar with RestEndpoints. Is there a good place to learn this information?
Also, I know script runner already has a built in "copy project" script
So I'm wondering if I can use that and just add these "RestEndpoints to this script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can actually call REST to clone with script runner
/rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.jira.admin.CopyProject
{"FIELD_SOURCE_PROJECT":"SOUCE_PROJECT_KEY""FIELD_TARGET_PROJECT":"TARGET_PROJECT_KEY""FIELD_TARGET_PROJECT_NAME":"TARGET_PROJECT_NAME" "canned-script":"com.onresolve.scriptrunner.canned.jira.admin.CopyProject"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would that code inside Payload like this?
Payload = json.dumps({
"FIELD_SOURCE_PROJECT":"SOUCE_PROJECT_KEY",
"FIELD_TARGET_PROJECT":"TARGET_PROJECT_KEY",
"FIELD_TARGET_PROJECT_NAME":"TARGET_PROJECT_NAME",
"canned-script":"com.onresolve.scriptrunner.canned.jira.admin.CopyProject"
)}
Because when I do this it tells me
"unrecognized field" \\\"FIELD_SOURCE_PROJECT\\\
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SOUCE_PROJECT_KEY is the project key you are copying
TARGET_PROJECT_KEY is the new project key
TARGET_PROJECT_NAME is the new project name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can it be clarified what a "canned script" is just so I know what I'm using and how it's working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is part of the body as you can see in my example from the job we created
{"FIELD_SOURCE_PROJECT":"' + @ProjectCopy + '","FIELD_TARGET_PROJECT":"' + @newProjectKey + '","FIELD_TARGET_PROJECT_NAME":"' + @newProjectName +'","canned-script":"com.onresolve.scriptrunner.canned.jira.admin.CopyProject"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.