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

SOAP Request example for custom field values

Mark Miller March 19, 2013

Hi there,

I'm trying to send a SOAP request from an external system to our internl JIRA system. If I send the request without the custom field value, all is okay and a new issue is created in JIRA. If, however, I add the custom field value, the request is not created. Therefore I know that the communcation is all fine. I cannot see anything in the logs, the only thing I see is the SOAP authentication which is successful.

I have not been able to find any example and I guess that my custom field value XML is invalid.

  1. Please can someone give me an example of how to pass the custom field value correctly.
  2. Which id is required for the customfieldId tag, is it the nice name, or the Id that is displayed in the issue's XML?

Many thanks,

Mark

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://soap.rpc.jira.atlassian.com" xmlns:tns1="http://beans.soap.rpc.jira.atlassian.com" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <createIssue xmlns="http://soap.rpc.jira.atlassian.com">
      <in0 xsi:type="xsd:string">${AuthHandle}</in0>
      <in1 xsi:type="bean:RemoteIssue" xmlns:bean="http://beans.soap.rpc.jira.atlassian.com">
          <project xsi:type="xsd:string">${Project}</project>
          <summary xsi:type="xsd:string">${ShortDescription}</summary>
          <description xsi:type="xsd:string">${Description}</description>
          <type xsi:type="xsd:string">${Type}</type>
          <status xsi:type="xsd:string">${Status}</status>
          <reporter xsi:type="xsd:string">${Reporter}</reporter>
            <customFieldValues xsi:type="jir:ArrayOf_tns1_RemoteCustomFieldValue" soapenc:arrayType="bean:RemoteCustomFieldValue[]" xmlns:jir="http://pgzugchsvn01:8080/rpc/soap/jirasoapservice-v2">
               <item>
                  <customfieldId xsi:type="xsd:string">customfield_10000</customfieldId>
                  <values soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
                     <item xsi:type="xsd:string">${IncidentNumber}</item>
                  </values>
                  <key xsi:nil="true"/>
               </item>
            </customFieldValues>
      </in1>
    </createIssue>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

JIRA version : v5.2.4#845-sha1:c9f4cc4

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Rajesh Badam January 4, 2017

Edit your request as below:

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://soap.rpc.jira.atlassian.com" xmlns:tns1="http://beans.soap.rpc.jira.atlassian.com" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <createIssue xmlns="http://soap.rpc.jira.atlassian.com">
      <in0 xsi:type="xsd:string">${AuthHandle}</in0>
      <in1 xsi:type="bean:RemoteIssue" xmlns:bean="http://beans.soap.rpc.jira.atlassian.com">
          <project xsi:type="xsd:string">${Project}</project>
          <summary xsi:type="xsd:string">${ShortDescription}</summary>
          <description xsi:type="xsd:string">${Description}</description>
          <type xsi:type="xsd:string">${Type}</type>
          <status xsi:type="xsd:string">${Status}</status>
          <reporter xsi:type="xsd:string">${Reporter}</reporter>
            <customFieldValues xsi:type="jir:ArrayOf_tns1_RemoteCustomFieldValue" soapenc:arrayType="bean:RemoteCustomFieldValue[]" xmlns:jir="http://pgzugchsvn01:8080/rpc/soap/jirasoapservice-v2">
               <item>
                  <customfieldId xsi:type="xsd:string">customfield_10000</customfieldId>
                  <values soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
                     <values xsi:type="xsd:string">${IncidentNumber}</values>
                  </values>
                  <key xsi:nil="true"/>
               </item>
            </customFieldValues>
      </in1>
    </createIssue>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
0 votes
Rajesh Badam January 4, 2017

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://soap.rpc.jira.atlassian.com" xmlns:tns1="http://beans.soap.rpc.jira.atlassian.com" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<createIssue xmlns="http://soap.rpc.jira.atlassian.com">
<in0 xsi:type="xsd:string">${AuthHandle}</in0>
<in1 xsi:type="bean:RemoteIssue" xmlns:bean="http://beans.soap.rpc.jira.atlassian.com">
<project xsi:type="xsd:string">${Project}</project>
<summary xsi:type="xsd:string">${ShortDescription}</summary>
<description xsi:type="xsd:string">${Description}</description>
<type xsi:type="xsd:string">${Type}</type>
<status xsi:type="xsd:string">${Status}</status>
<reporter xsi:type="xsd:string">${Reporter}</reporter>
<customFieldValues xsi:type="jir:ArrayOf_tns1_RemoteCustomFieldValue" soapenc:arrayType="bean:RemoteCustomFieldValue[]" xmlns:jir="http://pgzugchsvn01:8080/rpc/soap/jirasoapservice-v2">
<item>
<customfieldId xsi:type="xsd:string">customfield_10000</customfieldId>
<values soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
<valuesxsi:type="xsd:string">${IncidentNumber}</values>
</values>
<key xsi:nil="true"/>
</item>
</customFieldValues>
</in1>
</createIssue>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

0 votes
Mark Miller March 25, 2013

Hi all,

Can anyone please provide me with an example SOAP request to the above question? Would really appreciated it.

regards,

Mark

0 votes
Janet Albion
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 19, 2013

Hi Mark,

From my understanding, you need to specify the custom field ID and option ID in the SOAP client

Mark Miller March 19, 2013

Hi Janet ...

thanks for the reply. Yes that would be the case if I was using a SOAP client. But this is a third party tool that where you are required to define the evelope and then simply add replacement keys which are replaced with real values before the whole envelope is sent.

Basically what I really need is an XML example showing me the correct way to define the payload (namely the custom field values). I'm sure that my syntax above is wrong.

I do not have the JIRA API installed and so cannot at the moment programatically create an example. I just need a payload example which I cannot find anywhere on the net.

regards,

Mark

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