We are able to perform IssueLinking in Jira 4.2 using JellyRunner manually using the following command.
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib">
<jira:LinkIssue key="OKDAC-5640" linkKey="OKDAC-5641" linkDesc="is a duplicate of"/>
</JiraJelly>
Please can you tell me how to execute this script from Java code...I dont want to do this manually.I want to write a Java code to perform IssueLinking if i pass the Issue Keys. Please tell me how to do this. Thanks in advance.
Community moderators have prevented the ability to post new answers.
If you are okay with dealing with HTTP requests you can do a simle POST command to the URL with the content data as below (of course with os_username and os_password parameters). I quicky saw this being POSTed by JIRA. You need to also figure out which are the form parameters which JIRA identifies to get the source issue key.
http://<<yourjira>>/secure/LinkExistingIssue.jspa
POST: linkDesc=relates+to&linkKey=<<issueIdToLink>>&comment=
Thanks Renjith..
This works fine...But its requires an atlassian token to perform this operation.Is there any way to get the token generated??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to run the Jelly scripts automatically, you should use the Jelly runner services. You can add it under Services and point to your script.
If you want to run it from a Java program, why do you need a Jelly script? Use JIRA JAVA APIs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wait, jelly code cannot be executed remotely. It is not a substitute for SOAP/REST APIs. Whatever you do with Jelly, you can do with a plugin.
And if you need to execute the already written code using Java, that must be a task or a service. As I said, you already have a Jelly service that can do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops...I found this code in some website and tried executing it.
I have created a custom service in Jira 4.2 with this jelly script.
Is it possible to execute this from command prompt?? I saw somewhere that
org.apache.commons.jelly.Jelly executes the script that we create. But i dont know how to do it. Can you help me with this.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jobin,
I use this script to link 2 existing issues in Jira 4.2. I was not able to link issues using SOAP API or REST. I already posted a thread and concluded based on the replies that its not possible to link remote issues in JIRA 4.2 through APIs. So went for Jelly Script.
But i need some java code in front to execute the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is it possible to use a jelly:soap tag to login to jira using soap wsdl url and execute this script from the above java code???
I am actually suppose to do Remote IssueLinking from java. But i learnt that its not possible in JIRA 4.2 and SOAP API. Is there any way to do this from java??
I tried to creaet a Service in JIRA 4.2 with the Jelly Script as the input and xml output. I filled the script into the text file from java code and made that service execute the script and generate output. But output is generated only after 2 minutes when the Service delay time is 1 minute. This doesnt work out.
I tried to do it via Http POST rquest from URL. I can fill the script in the Text Area specified in Jelly Runner. But cannot execute.
Please can you tell me what am i to do with this Issue Linking...
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jobin, Since we are not able to do issue linking in JIRA 4.2 using SOAP API and REST API we are using jelly scripts to solve the problem as a work around.
Please let me know how we can execute a jelly script using HTTP POST method from java code. We had tried to use the JellyRunner.jspa URL to post the jelly script but not able to do it. Please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have written the following Java code to execute a Jelly Script.
File file = new File("IssueLinking-Jelly.jelly"); Writer someWriter = new FileWriter( "output.xml"); XMLOutput output = XMLOutput.createXMLOutput( someWriter ); JellyContext context = new JellyContext(); context.runScript(s, output ); System.out.println(output.toString());
And also modified the Jelly Script as
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib"> <jira:Login username="loginname" password="loginpwd"> <jira:LinkIssue key="issuekey1" linkKey="issuekey2" linkDesc="duplicates"/> </jira:Login> </JiraJelly>
But it throws the following exception.
org.apache.commons.jelly.JellyTagException: Sync1/IssueLinking-Jelly.jelly:2:53:
<jira:Login> com.atlassian.jira.jelly.tag.login.Login
doesn't have any satisfiable constructors.
Unsatisfiable dependencies:
[[interface com.atlassian.jira.security.JiraAuthenticationContext]] at
org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:671)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:259)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65)
at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:102)
at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:704)
at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:668)
at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:621)
at com.mmi.firebirdodartsync.IssueDuplication.main(IssueDuplication.java:85)
Caused by: org.picocontainer.defaults.UnsatisfiableDependenciesException:
com.atlassian.jira.jelly.tag.login.Login doesn't have any satisfiable constructors.
Unsatisfiable dependencies:
[[interface com.atlassian.jira.security.JiraAuthenticationContext]]
Please tell us how can this be solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.