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

Add component in createIssue

Firstname Lastname May 21, 2012

Hi,

Can someone tell me what is wrong in this createIssue? I want to add a component. So I am using soapenc:arrayType="bean:RemoteComponent[1]" and adding 'RemoteComponent' and 'name'. What is the right way to do this?

<components xsi:type="jir:ArrayOf_tns1_RemoteComponent" soapenc:arrayType="bean:RemoteComponent[1]" xmlns:jir="https://server/rpc/soap/jirasoapservice-v2">
      <RemoteComponent>
      <name>Some component - My Component I want to add to the issue</name>
      </RemoteComponent>
</components>

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

   <soapenv:Header/>

   <soapenv:Body>

      <soap:createIssue soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

         <in0 xsi:type="xsd:string">305JrgpNK8</in0>

         <in1 xsi:type="bean:RemoteIssue" xmlns:bean="http://beans.soap.rpc.jira.atlassian.com">

            <affectsVersions xsi:type="jir:ArrayOf_tns1_RemoteVersion" soapenc:arrayType="bean:RemoteVersion[]" xmlns:jir="https://server/rpc/soap/jirasoapservice-v2"/>

            <assignee xsi:type="xsd:string">admin</assignee>

            <attachmentNames xsi:type="jir:ArrayOf_xsd_string" soapenc:arrayType="xsd:string[]" xmlns:jir="https://server /rpc/soap/jirasoapservice-v2"/>

            <components xsi:type="jir:ArrayOf_tns1_RemoteComponent" soapenc:arrayType="bean:RemoteComponent[1]" xmlns:jir="https://server/rpc/soap/jirasoapservice-v2">

      <RemoteComponent>

      Some component - My Component I want to add to the issue

      </RemoteComponent>

            </components>

            <created xsi:type="xsd:dateTime">2012-05-20T20:08:59.000Z</created>

            <customFieldValues xsi:type="jir:ArrayOf_tns1_RemoteCustomFieldValue" soapenc:arrayType="bean:RemoteCustomFieldValue[]" xmlns:jir="https:// server/rpc/soap/jirasoapservice-v2"/>

            <description xsi:type="xsd:string">?</description>

            <duedate xsi:type="xsd:dateTime">2012-05-20T20:08:59.000Z</duedate>

            <environment xsi:type="xsd:string"></environment>

            <fixVersions xsi:type="jir:ArrayOf_tns1_RemoteVersion" soapenc:arrayType="bean:RemoteVersion[]" xmlns:jir="https://server/rpc/soap/jirasoapservice-v2"/>

            <key xsi:type="xsd:string"></key>

            <priority xsi:type="xsd:string">5</priority>

            <project xsi:type="xsd:string">TEST</project>

            <reporter xsi:type="xsd:string">user1</reporter>

            <resolution xsi:type="xsd:string"></resolution>

            <status xsi:type="xsd:string"></status>

            <summary xsi:type="xsd:string">Test for API</summary>

            <type xsi:type="xsd:string">3</type>

            <updated xsi:type="xsd:dateTime">2012-05-20T20:08:59.000Z</updated>

            <votes xsi:type="xsd:long">0</votes>                                    

         </in1>

      </soap:createIssue>

   </soapenv:Body>

</soapenv:Envelope>

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2012
Firstname Lastname May 23, 2012

Thanks Dieter. I tried that too. Didn't work. Donno what is wrong on here. Going crazy.

:components =>  [{'id' => '10914'}]

Firstname Lastname May 23, 2012

Yes it does exist. I can manually add it after soap call makes an issue. And I can pull the list getComponents.

:components =>  [{'id' => '10914'},{'name' => 'System update'}]

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2012
Is field Components on the Create screen ?
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2012
Yes, that's what i mean. It should be on the screen when you create the issue manually
Firstname Lastname May 23, 2012

Wait. Did you mean, is component option is available while manually creating an issue? No its not there.

Firstname Lastname May 23, 2012

So that means I cannot add component while creating an issue? So I have to make another updateIssue soap call to add a component.

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2012
Of course you can. You just need to add the field "component/s" to your create screen.The Soap interface respects the screens as noted in the yellow box at https://developer.atlassian.com/display/JIRADEV/Creating+a+JIRA+SOAP+Client
Firstname Lastname May 23, 2012

hmmm. I am not the top level administrator to change that setting. I am only responsible one project and making API calls for it. I do have component field in edit issue.

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2012
Of course if you don't want to set the component while creating an issue (e.g. Because the reporter does not have the knowledge to do that) you would have to use an additional updateIssue afterwards. But also in this case it must be made sure the component field is on the Edit screen. simply, Soap can only change fields that are on the correspondig screens
Firstname Lastname May 23, 2012

Understood. Now another quick question - Do I use components in updateIssue just like the way I was trying in createIssue? If I get a good example then I it will be easy. Because I actually tried earlier to update components using updateIssue, I had same trouble there too.

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2012
UpdateIssue expects an array of RemoteFieldValue objects. There is an example how to do it in Perl at https://jira.atlassian.com/browse/JRA-9229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#issue-tabs I guess it's important to suppress the agressive type casting of Perl as described in the example to set the priority field. For your case, instead of 'priority' just use 'components' and the value array after that should contain the ids of the components to be set

But i am not sure if it works since i'm not a perl developer and haven't verified it

Firstname Lastname May 23, 2012

Thanks Dieter for the help.

It never worked for me, I was using savon. and I decided to use jiraSOAP gem.

0 votes
Firstname Lastname May 22, 2012

Seriously? No one has any idea on this? Atlassian's support is unresponsive too.

:components => {'components' => {'id' => '10786', 'name' => 'General Troubleshooting'}}

http://docs.atlassian.com/rpc-jira-plugin/4.3.3/com/atlassian/jira/rpc/soap/beans/RemoteComponent.html

public class RemoteComponentextends AbstractNamedRemoteEntity

<th align="left" colspan="2">Constructor Summary</th>
RemoteComponent()
RemoteComponent(org.ofbiz.core.entity.GenericValue gv)
RemoteComponent(java.lang.String id, java.lang.String name)
0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2012

Does the component exist?

Firstname Lastname May 21, 2012

Yes. Very much does exist. I can pull a list of components using getComponents

Here I added some example name.

But here is a real one from getComponents .

<multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:RemoteComponent" xmlns:ns4="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

<id xsi:type="xsd:string">14924</id>

<name xsi:type="xsd:string">System Check - Version changed</name>

</multiRef>

The createIssue just ignores the conponent without any error and creates an issue.

I tried these too -

<RemoteComponent>

<name xsi:type="xsd:string" > System Check - Version changed </name>

</RemoteComponent>

<RemoteComponent>

<id xsi:type="xsd:int" >14924</id>

</RemoteComponent>

Firstname Lastname May 21, 2012

Is there any documentation that shows the actual raw XML structure of all SOAP methods?

0 votes
Firstname Lastname May 21, 2012

anybody ????

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events