J tricks - Little JIRA Tricks
  • Home
  • Plugins ↓
    • JQL Tricks Plugin
      • JQL Tricks Plugin - Cloud
        • JQLT Cloud Installation
        • JQLT Cloud Configuration
        • JQLT Cloud Usage
        • JQLT Cloud License
        • JQLT Cloud FAQ
      • JQL Tricks Plugin - DC
        • JQLT DC Installation
        • JQLT DC Configuration
        • JQLT DC Usage
          • JQLT Issue Functions
          • JQLT Subtask Functions
          • JQLT Links Functions
          • JQLT Development Functions
          • JQLT Worklog Functions
          • JQLT Project Functions
          • JQLT Component Functions
          • JQLT Version Functions
          • JQLT Group Functions
          • JQLT User Functions
          • JQLT Date Functions
        • JQLT DC License
        • JQLT DC FAQ
        • JQLT DC Known Issues
        • JQLT DC Performance
      • JQL Tricks Cloud Migration
    • Simplified Planner
      • J-Planner Installation
      • J-Planner Configuration
      • J-Planner Usage
        • Creating a plan
        • Editing a plan
        • Deleting a plan
        • Viewing a plan
        • Modifying a plan
      • J-Planner FAQ
    • Atla-Search Plugin
      • Atla-Search Installation
      • Atla-Search Configuration
      • Atla-Search Usage
      • Atla-Search License
      • Atla-Search FAQ
    • Copy to subtask Plugin
    • All Plugins
  • Tutorials
  • The Book
  • Contact Us
  • Home
  • Plugins ↓
    • JQL Tricks Plugin
      • JQL Tricks Plugin - Cloud
        • JQLT Cloud Installation
        • JQLT Cloud Configuration
        • JQLT Cloud Usage
        • JQLT Cloud License
        • JQLT Cloud FAQ
      • JQL Tricks Plugin - DC
        • JQLT DC Installation
        • JQLT DC Configuration
        • JQLT DC Usage
          • JQLT Issue Functions
          • JQLT Subtask Functions
          • JQLT Links Functions
          • JQLT Development Functions
          • JQLT Worklog Functions
          • JQLT Project Functions
          • JQLT Component Functions
          • JQLT Version Functions
          • JQLT Group Functions
          • JQLT User Functions
          • JQLT Date Functions
        • JQLT DC License
        • JQLT DC FAQ
        • JQLT DC Known Issues
        • JQLT DC Performance
      • JQL Tricks Cloud Migration
    • Simplified Planner
      • J-Planner Installation
      • J-Planner Configuration
      • J-Planner Usage
        • Creating a plan
        • Editing a plan
        • Deleting a plan
        • Viewing a plan
        • Modifying a plan
      • J-Planner FAQ
    • Atla-Search Plugin
      • Atla-Search Installation
      • Atla-Search Configuration
      • Atla-Search Usage
      • Atla-Search License
      • Atla-Search FAQ
    • Copy to subtask Plugin
    • All Plugins
  • Tutorials
  • The Book
  • Contact Us

Creating a JIRA SOAP Client

8/22/2010

74 Comments

 
It is very obvious! If you are reading this, you must be knowing how important it is to have an external interface for JIRA and how Atlassian helps by providing a SOAP interface. In an enterprise, or even in small companies for that matter, we often end up integrating JIRA with multiple systems. Creating a SOAP Client is a recommended and easy solution in such scenarios.

In fact, JIRA enables remote access through both SOAP and XML-RPC. SOAP is recommended because it covers more operations!
Before you can access JIRA through its SOAP API, you need to enable the JIRA rpc plugin. More on this and the creation of SOAP client can be found in the Atlassian pages. There are few examples as well to get you started.

So how does it all fit together? What are the simple steps to create a SOAP client.

1. Download the latest demo SOAP client distribution from the Atlassian public repository. This contains a Maven 2 project configured to use Apache Axis, and a sample Java SOAP client which creates test issues in http://jira.atlassian.com.  You can alternatively download the source code at the end of the tutorial!

2. Modify the 'jira.soapclient.jiraurl' property in your pom.xml to point to your JIRA instance. By default it points to http://jira.atlassian.com

3. You can find the wsdl file under the /src/main/wsdl location. If it is not there or if you want to download the wsdl afresh, run the following command.

mvn -Pfetch-wsdl -Djira.soapclient.jiraurl=http://{your_jira_instance}/


This will download the wsdl from the configured JIRA instance (as in Step 2) to /src/main/wsdl/. Skip the last property to download the Atlassian JIRA WSDL.

4. Now we have the wsdl ready and it is time to create the client jar. Run the following command to generate the sources from the wsdl and to create the SOAP client.

mvn -Pbuildclient


This will generate a jar file with all the necessary classes required. There is a second jar file created with the dependencies (axis et. al.) embedded in it. The latter will do a world of good if you are executing it from an environment without axis etc already configured in it.

Let us now look at writing our SOAP program. We are trying the simplest approach , i.e to create the an Eclipse project by running the following.

mvn eclipse:eclipse


You can alternatively try other IDEs or even run from command prompt , whatever is convinient. Let us just look at writing a simple program that just logs into our JIRA instance.

From now on, it is just another webservice invocation! The first step in writing the SOAP client is to get the SOAP service locator. Once you have the locator, get the SOAP service instance from the same by passing a new URL (of your JIRA instance).

jiraSoapServiceLocator = new JiraSoapServiceServiceLocator();
jiraSoapService = jiraSoapServiceLocator.getJirasoapserviceV2(new URL(your_url));


Now you can login to JIRA simply by invoking the login operation as follows.

String token = getJiraSoapService().login(your_username, your_password);


The token here is very important as it is used for all the other operations instead of logging in every time. You can see the token as the first argument in all other operations.

Let us just try getting an issue using the key and print its key and id to prove that this stuff works!

RemoteIssue issue = jiraSoapService.getIssue(authToken, ISSUE_KEY);
System.out.println("Retrieved Issue:"+issue.getKey()+" with Id:"+issue.getId());


Hopefully that gives you a fair idea to get started with your first SOAP client!  There are lot more you can do with the SOAP client some of which we will explain in our upcoming tutorials. Download some of the examples below. And don't forget to post your comments/feedback!
jira-soap-client.zip
File Size: 20 kb
File Type: zip
Download File

74 Comments
Divya Arun
3/29/2011 02:16:15 am

Hi,
I have a BIG issue and hope you can help me with it.
have written a SOAP Java client which sits on application A and talks to my JIRA to get issues.

The user (say user1) in application A wants to know all the JIRA Issue key that belongs to his/her projects where the user1 can be assigned to any of the issue. I have accomplished the JQL required for this and created a filter visible to all. This will repeat for user2, user3, ....usern from application A.

JQL for user1 is: project in projectsWhereUserHasPermission("Assignable User")

The issue is user1 has to pass his JIRA username and password to my SOAP client to run this JQL on his/her behalf. I want to avoid this.

1st solution: From SOAP, I want to log in as admin and run the query for user1, user2 .....usern

Something like JQL: project in projectsWhereUserHasPermission("Assignable User") and currentUser()="user1"

2nd solution: Login as admin, Get the username and password from JIRA for user1 and then run the JQL as user1

Hope I have made my issue clear? Please share your insights

Thanks,
Divya Arun

Reply
J-Tricks
4/13/2011 07:46:52 am

Option 2 will never work as it is against the security policies and JIRA will never allow it.

Option 1 looks good but I am not sure why the user you pass is not working if it is a cutsom JQL Function written by you. Or am Im missing something?

Regards,
Jobin

Reply
Rym
4/28/2011 06:35:08 am

Hello,
when I execute mvn -Pbuildclient an error accure :
[rym@localhost ~]$ mvn -Pbuildclient
[INFO] Scanning for projects...
[WARNING]
Profile with id: 'buildclient' has not been activated.

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO]

You must specify at least one goal or lifecycle phase to perform build steps.
The following list illustrates some commonly used build commands:

mvn clean
Deletes any build output (e.g. class files or JARs).
mvn test
Runs the unit tests for the project.
mvn install
Copies the project artifacts into your local repository.
mvn deploy
Copies the project artifacts into the remote repository.
mvn site
Creates project documentation (e.g. reports or Javadoc).

Please see
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
for a complete description of available lifecycle phases.

Use "mvn --help" to show general usage information about Maven's command line.


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Apr 28 18:27:58 EDT 2011
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------



where is the problem!! Please I need help

Reply
J-Tricks
4/28/2011 06:47:45 am

Which folder are you running this command from? You should run it from the folder where the pom.xml resides (i.e. jira-soapclient folder).

Reply
Rym
4/28/2011 10:00:57 am

Hello again,
I have runned the cmd from the right folder another error accured :(( .
Should I add somthing to pom.xml besides the URL of the instance of JIRA??

The error is:

C:\Documents and Settings\Administrateur\proj\jira-soap-client>mvn -Pbuilclient
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/com/atlassian/jira/plugins/atlassian-jira-rpc-parent/4.1.1-1/atlassian-jira-rpc-parent-4.1.1-1.pom
[INFO] Unable to find resource 'com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.atlassian.jira.plugins:jira-soapclient:jar:null

Reason: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins:jira-soapclient:jar:null for project com.atlassian.jira.plugi
ns:jira-soapclient:jar:null


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins:jira-soapclient:jar
:null for project com.atlassian.jira.plugins:jira-soapclient:jar:null
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins:jira-so
apclient:jar:null for project com.atlassian.jira.plugins:jira-soapclient:jar:null
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
... 12 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'com.atlassian.jira.plugins:atlassian-jira-rpc-parent' not found in repository: Unable to download the artifact from
any repository

com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

for project com.atlassian.jira.plugins:atlassian-jira-rpc-parent
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1

from the specified remote repositories:
central (http://repo1.maven.org/maven2)


at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
at org.apache.maven.artifac

Reply
J-Tricks
4/28/2011 10:08:56 am

Well, atleast one hurdle is over!

The above error is because the correct repositories are not specified under the maven seetings.xml.

The easy step is to use Atlassian Plugin SDK : http://confluence.atlassian.com/display/DEVNET/Developing+your+Plugin+using+the+Atlassian+Plugin+SDK

You can also configure the repositories manually as mentioned at http://confluence.atlassian.com/display/DEVNET/Atlassian+Maven+Repositories

Reply
Mukund
3/5/2012 11:28:35 pm

I am getting below exception
.maven.reactor.MavenExecutionException: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins:jira-soapclient:ja
project com.atlassian.jira.plugins:jira-soapclient:jar:null
org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)


when i tried to access these link i am not able to connect it seems these are moved somewhere ......

i am not able to access any of the link
http://confluence.atlassian.com/display/DEVNET/Developing+your+Plugin+using+the+Atlassian+Plugin+SDK

http://confluence.atlassian.com/display/DEVNET/Atlassian+Maven+Repositories



Please suggest..

Reply
J-Tricks
3/6/2012 12:34:40 am

They are now moved to the Developers wiki. See https://developer.atlassian.com/display/DOCS/Atlassian+Maven+Repositories

https://developer.atlassian.com/display/DOCS/Developing+with+the+Atlassian+Plugin+SDK

Mukund
3/6/2012 03:56:46 pm

What are the changes required . Do i need to change the pom file with updated repository or something else ...

I am still getting these exception

.maven.reactor.MavenExecutionException: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins:jira-soapclient:ja
project com.atlassian.jira.plugins:jira-soapclient:jar:null
org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)

Please Suggest ..

Rym
4/28/2011 08:15:59 pm

Hello again :)
I think that Atlassian Plugin SDK can't be used with JIRA 3.13 , I will try to do that manually

Thank you

Reply
J-Tricks
4/28/2011 08:37:52 pm

Cool.. Check out this page as well : http://confluence.atlassian.com/display/DEVNET/How+to+develop+without+the+Atlassian+Plugin+SDK

May be the Obsolete PDK will work for 3.13.

Reply
randi
5/2/2011 04:48:07 pm

Hi,
Nice post!. I was able to create a JIRA SOAP client and invoke remote operations successfully. However now I need to invoke operations on a JIRA which is configured to throw a captcha to users on login. Are there any API methods that can be used to handle login in such a scenario?

Thanks in advance,
Randi.

Reply
J-Tricks
5/2/2011 07:13:13 pm

Frankly I haven't ever tried it. Can't see any specific methods also. Will wait for someone to answer your query in the forums :)

Reply
med
5/4/2011 03:16:58 am

Hello,


I have developed an XML RPC client to extract data from JIRA,this is the code:

public static final String JIRA_URI = "URL";
public static final String RPC_PATH = "/rpc/xmlrpc";
public static final String USER_NAME = "logini";
public static final String PASSWORD = "PWD";
public static final String searchTerms = "";
private static final int maxNumResults = 1000;
private static final Status Exécution = null;

/**
* @param args
*/

public static void main(String[] args) {
// TODO Auto-generated method stub

try {
org.codehaus.swizzle.jira.Jira jira = new Jira(JIRA_URI);
jira.login(USER_NAME, PASSWORD);

Vector v = new Vector();

v.add("PUBPROJECT"); // le ou les projets sur lesquels on va effectuer la recherche

List<Issue> ticket=jira.getIssuesFromTextSearchWithProject(v, searchTerms, maxNumResults);

if ((ticket.get(0).getStatus().toString()).equals("En Attente d'éxécution"))
{

System.out.println(ticket.get(0).getKey());
System.out.println(ticket.get(0).getType());
System.out.println(ticket.get(0).getSummary());
System.out.println(ticket.get(0).getComponents());
System.out.println(ticket.get(0).getPriority());
System.out.println(ticket.get(0).getStatus());
System.out.println(ticket.get(0).getCustomFieldValues());

}

} catch (MalformedURLException e) {

e.printStackTrace();

} catch (Exception e) {
e.printStackTrace();

}

}

But with this code I can't retrieve all data ,for example by using:

System.out.println(ticket.get(0).getCustomFieldValues() I cann't extract customfieldvalue

When I run it I have this result :

customfield_10443, customfield_10080, customfield_10434, customfield_10445, customfield_10150, customfield_10198, customfield_10461, customfield_10444]


I need to extract data exists in this customfield.

Thank you

Reply
J-Tricks
5/4/2011 08:23:59 am

You should get them as RemoteCustomFieldValue and print them as shown in the PrintAllCFs class in the attached source.

Like this:

RemoteCustomFieldValue[] cfValues = issue.getCustomFieldValues();
for (RemoteCustomFieldValue remoteCustomFieldValue : cfValues) {
String[] values = remoteCustomFieldValue.getValues();
for (String value : values) {
System.out.println("Value for CF with Id:" + remoteCustomFieldValue.getCustomfieldId() + " -" + value);
}
}

Reply
med
5/5/2011 03:02:23 am

Thnx J-Tricks, I try with this code, I make some modifications :

List<CustomFieldValue> cfValues = ticket.get(0).getCustomFieldValues();
for (int i=0;i<cfValues.size();i++)
{
List<String> values = extracted(cfValues, i);
for (int j=0;j<values.size();j++)
{
System.out.println("Value for CF with Id:" + remoteCustomFieldValue.getCustomfieldId() + " -" + values.get(j));

}
}



but I have an inexplicable error(the underline one)

When I run the code I have this error :

"Exception in thread "main" java.lang.Error: Unresolved compilation problem:
remoteCustomFieldValue cannot be resolved

at org.hra.test.MainClass.main(MainClass.java:78)"

while I have the RemoteCustomFieldValue class !!!

any idea please?

Reply
J-Tricks
5/5/2011 06:51:35 am

Bit confused.. I am not seeing the remoteCustomFieldValue variable either! Where have you declared it? RemoteCustomFieldValue is the class, not an instance, right?

Reply
med
5/8/2011 10:17:19 pm

Yes RemoteCustomFieldValue is the class, not an instance.

Reply
Venkat Prasad
5/8/2011 11:04:59 pm

Any help, appreciate on this error. Thank you. Note: it works on windows tomcat, but not linux version!

Basically, I am trying to remove user from the group.

System.out.print("not present now -> " + jUser.getFullname());
jiraSoapService.removeUserFromGroup(soapToken, remoteGroup, jUser);



-------------------------------------
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{}faultData:null
{http://xml.apache.org/axis/}hostname:xxxxxxxxxxxxxxxxxxxx

java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.atlassian.jira.rpc.soap.client.JirasoapserviceV2SoapBindingStub.removeUserFromGroup(JirasoapserviceV2SoapBindingStub.java:5656)
at org.broadcom.dao.SoapThread.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
Successfully Logout.
Exchange/DLM & Jira groups update, Successful!

Reply
J-Tricks
5/9/2011 07:48:57 am

@med I am seeing only remoteCustomFieldValue which is not declared anywhere. That is the reason for compilation error. It is not the class because it starts with small 'r'.

Reply
J-Tricks
5/9/2011 07:51:32 am

@Venkat What is on linux machine? The client code? If so, did you look for any class path issues? Different versions of jar etc?

Reply
Michel
5/11/2011 10:49:08 pm

hello everybody,

I have question to ask you :
can I modify the status of my jira project 's issue or add comment or assign the isuue to a group or person via a client XML RPC.

I want to know if there is any code (specially for the modification of the status)
Could anybody helps me please?

thnx,

Reply
J-Tricks
5/12/2011 09:45:44 am

I haven't seen a method for this in XML/RPC. There is one in SOAP though : progressWorkflowAction

Checkout http://svn.atlassian.com/svn/public/atlassian/rpc-jira-plugin/tags/atlassian_jira_4_1_1_1/jira-soapclient/src/main/java/com/atlassian/jira_soapclient/exercise/WorkflowSoapExerciser.java

Reply
Mahalingam link
5/19/2011 03:25:37 am

Hi,am trying to build but am getting error..Can you give me a idea what should specify at pom.xml and settings.xml,

C:\jira-soap-client>mvn -Pbuildclient
[INFO] Scanning for projects...
Downloading: https://m2proxy.atlassian.com/repository/public/com/atlassian/jira/plugins/atlassian-jira-rpc-parent/4.1.1-1/atlassian-jira-rpc-parent-4.1.1-1.pom
[WARNING] Unable to get resource 'com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1' from repository atlassian-public (https://m2proxy.atlassian.co
Downloading: file://${env.ATLAS_HOME}/repository/com/atlassian/jira/plugins/atlassian-jira-rpc-parent/4.1.1-1/atlassian-jira-rpc-parent-4.1.1-1.pom
[INFO] Unable to find resource 'com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1' in repository atlassian-plugin-sdk (file://${env.ATLAS_HOME}/rep
Downloading: http://repo1.maven.org/maven2/com/atlassian/jira/plugins/atlassian-jira-rpc-parent/4.1.1-1/atlassian-jira-rpc-parent-4.1.1-1.pom
[INFO] Unable to find resource 'com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.atlassian.jira.plugins:jira-soapclient:jar:null

Reason: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins:jira-soapclient:jar:null for project com.


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugins
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:421)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:295)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: com.atlassian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1377)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:820)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:505)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:626)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:504)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:408)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'com.atlassian.jira.plugins:atlassian-jira-rpc-parent' not found in repository: Unable to downlo

com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1

from the specified remote repositories:
atlassian-public (https://m2proxy.atlassian.com/repository/public),
atlassian-plugin-sdk (file://${env.ATLAS_HOME}/repository),
central (http://repo1.maven.org/maven2)

for project com.atlassian.jira.plugins:atlassian-jira-rpc-parent
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:602)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1373)
... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1

from the specified remote repositories:
atlassian-public (https://m2proxy.atlassian.com/repository/public),
atlassian-plugin-sdk (file://${env.ATLAS_HOME}/repository),
central (http://repo1.maven.org/maven2)


at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)

Reply
J-Tricks
5/19/2011 08:12:22 am

Looks like you are running it behind a firewall. If so, add the proxy settings in your maven settings.xml. For details check http://maven.apache.org/guides/mini/guide-proxies.html .

If you are not behind a firewall, it is worth trying after turning off the antivirus.

Reply
Mahalingam link
5/20/2011 12:43:56 am

Thanks for your reply J-Tricks.
I tried with proxy and firewall off,antivirus.but still headsdown,I shows parent not found,can you help.

C:\jira-soap-client>mvn -Pbuildclient
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/com/atlassian/jira/plugins/atlassian-
jira-rpc-parent/4.1.1-1/atlassian-jira-rpc-parent-4.1.1-1.pom
[WARNING] Unable to get resource 'com.atlassian.jira.plugins:atlassian-jira-rpc-
parent:pom:4.1.1-1' from repository central (http://repo1.maven.org/maven2): Err
or transferring file
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: com.atlassian.jira.plugins
ArtifactId: atlassian-jira-rpc-parent
Version: 4.1.1-1

Reason: Unable to download the artifact from any repository

com.atlassian.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1

from the specified remote repositories:
central (http://repo1.maven.org/maven2)



[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atlass
ian.jira.plugins:atlassian-jira-rpc-parent for project: com.atlassian.jira.plugi
ns:jira-soapclient:jar:null for project com.atlassian.jira.plugins:jira-soapclie
nt:jar:null

Reply
J-Tricks
5/20/2011 06:04:19 am

I am afrid I haven't got a clue here! Surely it must be an environment thing.

If you figure it out, please post a comment so that others who face the same will be able to resolve it quickly!

Reply
Mahalingam
5/31/2011 12:59:55 am

Using WSDL i have created the stubs using eclipse webservice client.
I have jira4.3 and using eclipse web service client I have generated client stubs(axis1.4).I am able to login and create issue but when I am trying to get the response , I get the error below. Please assist me in how to solve this, thank you.
java.lang.ClassCastException: java.lang.Boolean cannot be cast to com.atlassian.crowd.embedded.api.User at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

Below is the codebase used:

JiraSoapService jiraSoapService = soapSession.getJiraSoapService();
String authToken = soapSession.getAuthenticationToken();

RemoteIssue issue = new RemoteIssue();
issue.setProject(PROJECT_KEY);
issue.setType(ISSUE_TYPE_ID);
issue.setSummary("JIRA Ticket created via SOAP client: Without Component ID");
issue.setPriority(PRIORITY_ID);
issue.setDuedate(Calendar.getInstance());
issue.setAssignee(ASSIGNEE_ID);
issue.setDescription("In future tickets may be created through some Web form in this way ");
RemoteIssue createdIssue = jiraSoapService.createIssue(authToken, issue);

Reply
J-Tricks
5/31/2011 01:29:50 am

Hi Mahalingam,

The code you have written looks good to me. So, what is happening in getAuthenticationToken method?

Also, is there any mandatory field you have on the issue that you are not populating?

Reply
Mahalingam
5/31/2011 06:36:57 pm

Hi J-Tricks,
Thank you. getAuthenticationToken is returning the token.It is able to login and also it is able to create the issue at JIRA.But only the response-RemoteIssue am not getting.It throws the Classcastexception.Am able to look the JIRA issue but i want the reponse(RemoteIssue) to get the issuekey.
-Mahalingam

Reply
J-Tricks
5/31/2011 07:19:16 pm

Do you mean the error is thrown at the last line?

RemoteIssue createdIssue = jiraSoapService.createIssue(authToken, issue);

Can you check the SOAP version you are using? It should be the latest one for JIRA 4.3. I am guessing you are using an older version of SOAP API (and hence RemoteIssue).

Reply
Monica
6/5/2011 11:03:45 pm

Hello,

I can connect with JIRA via my SOAP cleint.

But I have some problems :

1/ I want to get issue by project (AUTOMATEKEY is the key of y project), I used this code

" RemoteProject P = fJiraSoapService.getProjectByKey(fToken, "AUTOMATEKEY");

String[]T = new String 10;

RemoteIssue[] s = fJiraSoapService.getIssuesFromTextSearchWithProject(fToken, T, searchTerms, maxNumResults); "

2/ I try to change the status of issue by using the method

progressWorkflowAction(java.lang.String token, java.lang.String issueKey, java.lang.String

actionIdString, RemoteFieldValue[] actionParams) but I don't know how I use it!!!

This is the code:

"
ticket = fJiraSoapService.progressWorkflowAction(fToken, "AUTOMATEKEY-3", ??????????, ??????????????); "

Any ideas please

Is there any code could help me lease.

Reply
J-Tricks
6/6/2011 07:16:37 am

Monica,

I suppose you are getting the issues using the first step and stumbled at the second?

The arguments to the progressWorkflowAction is what Nic mentioned in the forums. i.e actionIdString and an array of actionParams one each for the fields you want to populate on the issue during transition. These fields should be part of the transition screen!

You can find example code in my next post on SOAP : http://www.j-tricks.com/1/post/2010/09/issue-via-soap.html in the attachment!

Reply
Mahalingam
6/7/2011 02:22:50 am

Hi J-Tricks,

I have downloaded evalution version of jira4.3.1 and tested the program it is working fine,returning the response.But the same soap or xml-rpc method is not returnning.It throws classcast exception related to crowd embeed user.Is there any configuration for enable/disable this?

-Mahalingam

Reply
J-Tricks
6/7/2011 11:54:21 am

@Mahalingam sorry I didn't understand that fully. Are you saying that you got it working with 4.3.1? By saying it is working fine, returning the response?

If so where is the error thrown now? Config to enable/disable what?

Reply
Mahalingam
6/7/2011 06:11:27 pm

I have 2 environment setup now .One is with evulation version of 4.3.1 it is working fine.Another env is production evn..when i run the same client program am getting the error message.I already posted the error message for your response.It is related to embedded user classcast exception.So i thought ask you about the config if any?-Thanks for your time.

Reply
J-Tricks
6/7/2011 07:19:45 pm

Which version is you production JIRA instance? Are you using a client that is compatiable with it? Since it is working with your test env, the code must be fine. It should be a version collision I suspected earlier.

The only config is to turn on Accept Remote API calls. But that is the not the problem in your case.

Reply
Mahalingam
6/8/2011 01:52:35 am

Production version is Jira4.3.1(same version i installed in my local machine)-the client code is working fine.I didnt get a clue why it is not working at production.I feel some configuartion related to embedded user is enabled.Still not able get any clue.Thanks for reponse.

Reply
J-Tricks
6/8/2011 09:16:56 pm

Doesn't ring any bell! Can you post back what the issue was if you figure it out later?

This would help others facing the same issue.

Reply
David
7/28/2011 05:42:00 am

Hello,

I downloaded the code you put down

And when I open it with eclipse there are bugs in some classes.

For example does not recognize these methods. I am attaching screenshot:


http://www.subirimagenes.com/otros-captura-6726610.html

Thanks

Reply
J-Tricks
8/1/2011 05:43:23 am

@David What are the methods that you find in the JiraSOAPServiceLocator ?

Reply
Charlie
8/3/2011 04:57:26 am

Now I have all the infrastructure in place.

The Java classes and Jira server but i don't know I have to do to run in Eclipse client and make calls to methods such as getIssue() or getUser() of JIRA

Reply
J-Tricks
8/6/2011 02:57:22 am

Hi Charlie,

Did you follow this tutorial? Do you have the libraries in classpath?

Reply
Anum
8/22/2011 05:15:38 pm

hello,
i am using jira 3.13.x, and i want to retrieve all the issues under a project, can you please give me a head start as to how to get it done.
any help will be appreciated

Reply
Anum
8/22/2011 05:17:36 pm

one more thing, what is i want to search the issue keys for a specific search term ,is it possible and will you elaborate how

Thank you

Reply
J-Tricks
8/23/2011 10:26:38 am

@Anum You can use the getIssuesFromFilter or getIssuesFromTextSearch method to get those information. Check out http://svn.atlassian.com/svn/public/atlassian/rpc-jira-plugin/tags/atlassian_jira_3_13_5_1/src/java/com/atlassian/jira/rpc/soap/JiraSoapService.java for some explanation on those methods.

Reply
Anum
8/23/2011 05:29:16 pm

ok, i used the getIssuesFromTextSearch method to get the desired issues, but i have realized the retrieved issues are the one with the closed status, how can i get the issues of desired status,i.e. open, in progress and reopened

Reply
Joe Caputo link
12/20/2011 07:30:00 am

Hi there,

Currently, we use the JIRA soap API to create users and modify group memberships based on our Active Directory groups/users. We decided to write our own custom solution because the nested groups behavior built by Atlassian currently does not meet our needs. The problem is, is that when a user is created via soap, the user is mailed that an account was created for them.

My question to you is, is there a way to suppress that message that gets sent out? In a prior version of JIRA, we were able to suppress this message by ensuring the External Password Management field in General configuration was set to true. Atlassian has now removed that field so now, any users added via the API, get an email sent to them. What can we do?

Reply
J-Tricks
12/20/2011 09:34:10 am

@Joe I have no idea! Maybe find that property name from the old JIRA instance and set it to false in the new one as described under http://confluence.atlassian.com/display/JIRA/Advanced+JIRA+Configuration ?

i.e by editing jura-config.properties file?

I am not sure if that will work but worth a shot. Atlassian has a habit of hiding stuff but the code might still be in there!

Reply
Sachin link
3/11/2012 11:34:17 pm

Hi I'm successfully able to set this up and could run the client. I am able to execute login successfully and getting the token, but when I invoking getIssue from jirasoapservice, on JIRA 4.4.4, i am getting following exception. Requesting to pls help me with this. Another thing, I am able to run this service and get th response on 4.2.2, its only issue I;m facing in 4.4.4.

{}faultData:<cause xmlns:ns2="http://lang.java" xsi:type="ns2:Throwable"><cause xsi:type="ns2:Throwable"><cause xsi:nil="true" xsi:type="ns2:Throwable"/><localizedMessage xsi:type="xsd:string">Unsupported feature</localizedMessage><message xsi:type="xsd:string">Unsupported feature</message><stackTrace soapenc:arrayType="ns2:StackTraceElement[256]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:Array"><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">oracle.jdbc.driver.DatabaseError</className><fileName xsi:type="xsd:string">DatabaseError.java</fileName><lineNumber xsi:type="xsd:int">125</lineNumber><methodName xsi:type="xsd:string">throwSqlException</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">oracle.jdbc.driver.DatabaseError</className><fileName xsi:type="xsd:string">DatabaseError.java</fileName><lineNumber xsi:type="xsd:int">162</lineNumber><methodName xsi:type="xsd:string">throwSqlException</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">oracle.jdbc.driver.DatabaseError</className><fileName xsi:type="xsd:string">DatabaseError.java</fileName><lineNumber xsi:type="xsd:int">227</lineNumber><methodName xsi:type="xsd:string">throwSqlException</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">oracle.jdbc.driver.DatabaseError</className><fileName xsi:type="xsd:string">DatabaseError.java</fileName><lineNumber xsi:type="xsd:int">537</lineNumber><methodName xsi:type="xsd:string">throwUnsupportedFeatureSqlException</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">oracle.jdbc.driver.PhysicalConnection</className><fileName xsi:type="xsd:string">PhysicalConnection.java</fileName><lineNumber xsi:type="xsd:int">3091</lineNumber><methodName xsi:type="xsd:string">prepareStatement</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">org.apache.commons.dbcp.DelegatingConnection</className><fileName xsi:type="xsd:string">DelegatingConnection.java</fileName><lineNumber xsi:type="xsd:int">384</lineNumber><methodName xsi:type="xsd:string">prepareStatement</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper</className><fileName xsi:type="xsd:string">PoolingDataSource.java</fileName><lineNumber xsi:type="xsd:int">430</lineNumber><methodName xsi:type="xsd:string">prepareStatement</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">org.ofbiz.core.entity.jdbc.interceptors.connection.DelegatingConnection</className><fileName xsi:type="xsd:string">DelegatingConnection.java</fileName><lineNumber xsi:type="xsd:int">215</lineNumber><methodName xsi:type="xsd:string">prepareStatement</methodName><nativeMethod xsi:type="xsd:boolean">false</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:string">sun.reflect.NativeMethodAccessorImpl</className><fileName xsi:type="xsd:string">NativeMethodAccessorImpl.java</fileName><lineNumber xsi:type="xsd:int">-2</lineNumber><methodName xsi:type="xsd:string">invoke0</methodName><nativeMethod xsi:type="xsd:boolean">true</nativeMethod></stackTrace><stackTrace xsi:type="ns2:StackTraceElement"><className xsi:type="xsd:stri

Reply
J-Tricks
3/12/2012 02:07:29 am

Seems you are getting a DB Exception. Looks like the problem comes from a plugin and not within your SOAP code.

Reply
Sabrina Chase
4/27/2012 07:04:33 am

I've downloaded the client project from the repository and even read the README file, but I am running into the problem of parent POM inheritance. It looks like there are at least three nested levels of POM files above the client. What are the necessary files and how do I get them without downloading the entire repository? Are there other dependencies that will need to be built before running the client? I don't need JIRA since I can point to our local version.

Reply
J-Tricks
4/27/2012 08:57:19 am

My guess is that you don't have settings.xml correctly configured! You don't need to add any dependencies by yourself.

Reply
Sabrina Chase
4/27/2012 09:04:58 am

That's entirely possible, but where do I find the correct values for the settings.xml? I looked on the atlassian site and found some for confluence (http://confluence.atlassian.com/display/CONF26/Atlassian+Maven+repositories) but I still get errors. I searched for Jira-specific dev settings but did not find them. Thanks...

kutty
6/14/2012 11:49:34 pm

i followed your tutorial and created the SOAP client, how to run it from eclipse?

Reply
J-Tricks
6/15/2012 02:02:43 am

The example already covers creating a client class in Eclipse. You can now call it just like any other Java projects in Eclipse. Just create a Main class with main method and then start invoking those methods!

Reply
Kavya
7/9/2012 10:59:16 am

Can you point me to the location where I can find the jar for the class "jiraSoapServiceLocator"?

Reply
J-Tricks
7/9/2012 03:01:52 pm

When you do "mvn -Pbuildclient" , the jar will be created! Follow the tutorial and you will see what I am talking about.

Reply
Srinivas
4/1/2013 01:05:51 pm

Thank you for this useful information. I configured SOAP client,performed some operations and found working fine. I got SocketTimedOutException when I tried to delete projects with more than 3000 issues though the projects are found deleted from UI. Will this approach creates any further issues?

Reply
J-Tricks
4/1/2013 01:31:47 pm

It won't create any issues. The actual operation takes more time and SOAP connection times out before it is completed.

Even though the client times out, operation will continue to run in the server and finish fine. If there are any errors, then you will find it in the logs.

Reply
Srinivas
4/1/2013 01:06:59 pm

I forgot to mention the error.
Running : Deleting Project ALN
________________________________________________________________
Deleting Project ALN took 52,985 ms to run

Running : Deleting Project AMBW
; nested exception is:
java.net.SocketTimeoutException: Read timed out
________________________________________________________________
Deleting Project AMBW took 602,211 ms to run

Running : Deleting Project AMQS
________________________________________________________________
Deleting Project AMQS took 247,867 ms to run

Running : Deleting Project AMRP
; nested exception is:
java.net.SocketTimeoutException: Read timed out
________________________________________________________________
Deleting Project AMRP took 603,420 ms to run

Reply
Nag link
8/28/2013 02:47:02 am

Hi,
I tried this Soap-client service , There is no problem with connection but when i tried to create new issue , I got the Following Errors.
Could you clarify me where should be the mistake.

Aug 28, 2013 12:57:17 PM org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
SOAP Session service endpoint at http://localhost:9080/rpc/soap/jirasoapservice-v2
Connnecting via SOAP as : admin
Connected
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: com.atlassian.jira.rpc.exception.RemoteValidationException: {components=Component with id '10,240' does not exist., fixVersions=Version with id '10,330' does not exist.} : []
faultActor:
faultNode:
faultDetail:
{}com.atlassian.jira.rpc.exception.RemoteValidationException:null
{http://xml.apache.org/axis/}hostname:Pratap-PC

com.atlassian.jira.rpc.exception.RemoteValidationException: {components=Component with id '10,240' does not exist., fixVersions=Version with id '10,330' does not exist.} : []
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at com.atlassian.jira.rpc.soap.client.RemoteValidationException.getDeserializer(RemoteValidationException.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.atlassian.jira.rpc.soap.client.JirasoapserviceV2SoapBindingStub.createIssue(JirasoapserviceV2SoapBindingStub.java:4043)
at com.jtricks.CreateSimpleIssue.createIssue(CreateSimpleIssue.java:82)
at com.jtricks.CreateSimpleIssue.main(CreateSimpleIssue.java:46)

Reply
J-Tricks
8/28/2013 02:58:18 am

I think you are using invalid component and version values?

{components=Component with id '10,240' does not exist., fixVersions=Version with id '10,330' does not exist.} : []

Reply
luke
9/18/2013 09:12:18 pm

Hello there,

i tried this tutorial, but this wont work for me..
i downloaded the zip after the tutorial and changed the path in the pom.xml but when i wann create the jars ( running the; mvn -Pbuildclient command in the same folder as the pom.xml is)

gettin the following error:
... 'mvn' is not recognized as an internal or external command, operable program or batch file..

seems sth missing ;)

could you tell me what i forgot to do and where i should run this command?

best regards!

Reply
J-Tricks
9/23/2013 07:39:04 am

Make sure maven is installed and is available in the path. If you have Atlassian SDK installed, it comes with maven. You can use the absolute path to SDK_install_dir/bin

Reply
raj
9/19/2013 07:21:39 pm

i am gettin the following error:

[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/com/atlassian/jira/plugins/atla
ssian-jira-rpc-parent/4.1.1-1/atlassian-jira-rpc-parent-4.1.1-1.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.atlassian.jira.plugins:jira-soapclient:4.1.1-1 (U:\Eig
ene Dateien\Projektdokumente\jira-soap-client\pom.xml) has 2 errors
[ERROR] Malformed POM U:\Eigene Dateien\Projektdokumente\jira-soap-client\po
m.xml: Unrecognised tag: 'relativepath' (position: START_TAG seen ...</version>\
n\t\t<relativepath>... @8:17) @ U:\Eigene Dateien\Projektdokumente\jira-soap-cl
ient\pom.xml, line 8, column 17 -> [Help 2]
[ERROR] Non-resolvable parent POM: Could not transfer artifact com.atlassian
.jira.plugins:atlassian-jira-rpc-parent:pom:4.1.1-1 from/to central (http://repo
.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' point
s at wrong local POM @ line 4, column 13: Unknown host repo.maven.apache.org ->
[Help 3]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseExce
ption
[ERROR] [Help 3] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableMo
delException

could you help me please i followed the tutorial, changed the directory of the pom, downloaded the wsdl file from my instance and was running the mvn -Pbuildclient command..

Best regards!

Reply
J-Tricks
9/23/2013 07:36:41 am

Looks like an issue with maven settings. Were you able to run fetch-wsdl successfully?

Reply
raj
9/23/2013 10:03:49 pm

Thx for your reply, and no it wasn't successful, i was getting the following error:

[Warning] The requested profile "fetch-wsdl" could not be activated because it does not exist.
[ERROR] No goals have been specified for this build. You must specify a valid li
fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id
>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-
test-classes, test, prepare-package, package, pre-integration-test, integration-
test, post-integration-test, verify, install, deploy, pre-site, site, post-site,
site-deploy, pre-clean, clean, post-clean. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifie
dException

Thanks for your help!! :)

J-Tricks
9/25/2013 03:11:16 pm

Seems the pom.xml is corrupted. Can you download the client in this example and see if that works?

raj
9/24/2013 06:52:00 am

Hey J-Tricks,

its me again.

got some Questions to your Tutorial, would be awesome if you could answer them.

Q1: Which Maven you used for the build? (I did it with 3.0.3)
Q2: Does the zip after the tutorial includes already all required files for building the jar files?
Q3: Do i only need to modify the url of my instance in the pom.xml ('jira.soapclient.jiraurl') ?
Q4: I downloaded the wsdl file from my instance and copied it in the /src/main/wsdl/ directory, right?

Then i was running only the Pbuildclient command, and it failed. (i was running this command in the pom.xml directory)

Could a missing proxy statment in the settings.xml cause this errors (firewall..)?

Best regards!! :)






































Reply
J-Tricks
9/25/2013 03:13:26 pm

1. I have used maven2 and specifically the one that comes with Atlassian Plugin SDK. Try that.
2. Maven will download the necessary dependencies, if not the internet
3. Yes
4. You can do that or use fetch-wsdl as mentioned in tutorial

Reply
raj
9/25/2013 08:51:17 pm

Thanks for answering.

now i am getting the same errors as Rym:

Error building POM<may not be this project's POM>.

You said that the repositories are not set correctly.
But how can i set them? Could you gimme an example pls?

Btw. those this Soap client work with Jira 4.3.2?

Sry for all that questions, but i am bit confused about all this errors, and i am new to maven ;-)

J-Tricks
9/26/2013 01:31:43 am

You have to change the wsdl to the one that is used by 4.3.2. Everything else will be same.

Regrading the error, please check the earlier suggestions and links. You can also search in google for that error. It is always a different reason for different people :)

mirketa link
11/14/2019 04:03:52 am

Thanks for sharing

Reply

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Author

    Jobin Kuruvilla - Works in Adaptavist as Head of DevOps Professional Services. 

    Author of JIRA Development Cookbook and JIRA 5.x Development Cookbook.


    RSS Feed

    Categories

    All
    Acive Objects
    Ajs
    Book
    Components
    Condition
    Custom Fields
    Customization
    Events
    Gadgets
    Javascript
    Jql
    Listener
    Mail
    Permissions
    Plugin Framework
    Post Function
    Properties
    Remote Invocation
    Reporting
    Rest
    Scheduled Tasks
    Search
    Services
    Soap
    Summit
    User Interface
    Validator
    Webwork Actions
    Workflow

    Archives

    October 2016
    August 2016
    March 2016
    January 2016
    December 2015
    May 2014
    December 2013
    November 2013
    July 2013
    June 2013
    April 2013
    October 2012
    September 2012
    August 2012
    July 2012
    May 2012
    March 2012
    February 2012
    January 2012
    December 2011
    November 2011
    June 2011
    May 2011
    April 2011
    March 2011
    February 2011
    January 2011
    November 2010
    October 2010
    September 2010
    August 2010

SUPPORT
APPS
TUTORIALS
THE BOOK
© J-Tricks