Re: Updating custom field values using a SOAP C# API
[email protected] Tue, 05 Jul 2011 09:30:14 CDT
| Newsgroups | gmane.comp.java.jira.user |
|---|---|
| Message-ID | <14126910.655941309876245169.JavaMail.j2ee_forums.atlassian.com@atlassian12.managed.contegix.com> |
Hi,
In the first example the value "id" is added to user created customfield whose id is 10137(say in this example as ABCId). So in the following code
*RemoteIssue remoteIssue = getJiraSoapService().getIssue(getToken(), key);*
u get the issue by passing the key.
*RemoteFieldValue fieldValue1 = new RemoteFieldValue("customfield_10137", new String[] {Id});*
i create a RemoteFieldValue which had the "Id" value to be updated to the customfield(in this eg ABCId).
*getJiraSoapService().updateIssue(getToken(),remoteIssue.getKey(),new RemoteFieldValue[]{ fieldValue1});*
update the issue with the new value for the custom field.
In your case, you had wanted to update the component/s(which is inbuilt). I suppose you would have to give
*RemoteFieldValue fieldValue1 = new RemoteFieldValue("component/s", new String[] {Id});*
For Resolution i have given as "resolution". So reporter it is "reporterFieldArea" so it must be somewhat like that for component/s as well.
This is regarding how you use RemoteFieldValue .
For the usage of RemoteCustomFieldValue, i hope the below example is clear.
{code}
RemoteIssue remoteIssue = getJiraSoapService().getIssue(getToken(), issueKey); // get the issue using the key
RemoteCustomFieldValue rcfv[] =remoteIssue.getCustomFieldValues(); // get all customfields of the issue
for (int j=0;j<rcfv.length;j++){ // looping through the above array
String customFieldId= rcfv[j].getCustomfieldId(); // id of the custom field
String[] customFieldValue= rcfv[j].getValues(); // value of the custom field
if ("customfield_10930".equals(customFieldId)){ // if i want the value of the customfield 10930
// do some work
}
}
All the above are in Java.. But i hope the api's and the parameters will remain the same.
{code}
--
Post by anitaj23 - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=55144
_______________________________________________
Jira-user mailing list
[email protected]
To unsubscribe or change your options visit this page:
http://lists.atlassian.com/mailman/listinfo/jira-user