Attend a User Group

Home » Atlassian Forums » Software » JIRA Development



Permlink Replies: 11 - Pages: 1 - Last Post: Jun 1, 2009 1:33 PM Last Post By: Royce Wong
Ali Ibrahim

Posts: 20
Registered: 05/28/08
JiraSoapService updateIssue parameters
Posted: Jun 10, 2008 1:48 PM
Click to report abuse...   Click to reply to this thread Reply
Hi,

I'm trying to use updateIssue(String token, String issueKey, RemoteFieldValue[] actionParams) from the JiraSoapService but I cannot find any information about the RemoteFieldValue object. Does anyone have any information about this? The documentation is very weak in some parts and it is extremely difficult to figure things out. Any help is greatly appreciated.
Ali Ibrahim

Posts: 20
Registered: 05/28/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 10, 2008 1:55 PM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
More specifically, how can I update the resolution. I can change priority but can't get resolution to work.
Ali Ibrahim

Posts: 20
Registered: 05/28/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 10, 2008 3:11 PM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
figured it out...you have to use progressWorkflowAction to change resolution and status.
Chris Fletcher

Posts: 33
Registered: 06/02/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 10, 2008 6:14 PM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
I need exactly the same thing. Is there any documentation on how to format each field's String[] in its RemoteFieldValue? (I think summary/desc/env have the NEW_SUMMARY/DESC/ENV be just the first item in String[], but I have no idea about the others.

C F

Edited by: Chris Fletcher on Jun 10, 2008 6:14 PM

Edited by: Chris Fletcher on Jun 10, 2008 6:15 PM
Ali Ibrahim

Posts: 20
Registered: 05/28/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 11, 2008 7:55 AM    global.in_response_to.tooltip in response to: Chris Fletcher
Click to report abuse...   Click to reply to this thread Reply
From what I've found, the first value in String[] will be the new value. I think this is the case for most of the fields.

Try putting different things in the array and see what values change. Sorry couldn't be more helpful...
Chris Fletcher

Posts: 33
Registered: 06/02/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 20, 2008 7:18 PM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
Hi Ali,

What exactly did you send to progressWorkflowAction() to get it to update the resolution/settings? I can't get it to work -=( I don't know what do set progressWorkflowAction()'s 3rd param to and don't know how to format the remoteFieldValue

Thanks,
C F
Ali Ibrahim

Posts: 20
Registered: 05/28/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 23, 2008 8:45 AM    global.in_response_to.tooltip in response to: Chris Fletcher
Click to report abuse...   Click to reply to this thread Reply
I created RemoteFieldValues for the items I wanted to update. The first field is the property you want to change, and the second is a String array containing the value you want to change it to. The value is usually a String id associated with that type. For example, the resolution "Fixed" has the id 1 so I would pass a String array with value 1. You can call getResolutions(token) to get a list of the available resolutions and to get the id call getId() on one of the resolutions.

String resolution[] = {"1"};
...
RemoteFieldValue resolutionField = new RemoteFieldValue("resolution", resolution);
RemoteFieldValue priorityField = new RemoteFieldValue("priority", priority);
RemoteFieldValue assigneeField = new RemoteFieldValue("assignee", assignee);

Then I created a RemoteFieldValue array with each of the RemoteFieldValues. The order in the array didn't seem to matter.
RemoteFieldValue[] remoteFields = {priorityField, assigneeField, resolutionField};

Before you can call progressWorkflowAction, you have to find the action id. This can be found on your JIRA install if you go to the administration page and go to the Global Settings section. You should find Workflows and you can choose the workflow you are working with. For our installiation, Resolve Issue has an action id of 5. I think you can also find this from a soap call but I can't remember what method it would be. Once you have that and the issueKey you can go ahead and make the call.

progressWorkflowAction(token, issueKey, action, remoteFields);

So that's all I did. You can also update more values such as the summary if you add another value to the RemoteFieldValue array. I'm sure you know where the documentation is but I'll post it anyways http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html . Also if you run the JIRA Maven2 SOAP Library extension with eclipse, you will get an error telling you if you're missing a field or if something isn't passed correctly. It can be found here http://confluence.atlassian.com/display/JIRAEXT/JIRA+Maven2+SOAP+Library .

Chris Fletcher

Posts: 33
Registered: 06/02/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 23, 2008 2:19 PM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
Thanks a ton for the primer =) It worked perfectly. Do you happen to know the action param format for dates? (due date for example)

Thanks!
C F
Ali Ibrahim

Posts: 20
Registered: 05/28/08
Re: JiraSoapService updateIssue parameters
Posted: Jun 23, 2008 4:07 PM    global.in_response_to.tooltip in response to: Chris Fletcher
Click to report abuse...   Click to reply to this thread Reply
Yea no problem. It took me a while to figure out...

I think dueDate should be a String. On our install it was dd/mmm/yy so today would be 23/Jun/08. If it's not a String, then it's a Calendar object.
bob.swift

Posts: 40
Registered: 12/28/05
Re: JiraSoapService updateIssue parameters
Posted: Apr 30, 2009 10:50 AM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
I seems like the server always expects duedate to be d/MMM/yy format for updateIssue and workflow transition no matter what the date setting is in JIRA - it would be helpful if this were documented. Can Atlassian confirm this as the design? Date format isn't a problem for createIssue and setting a version date since these are passed as date objects. But the RemoteFieldValue's are strings, so it must be a string representation. I am not sure why it isn't specified in the server format, but it is easy enough to convert to the other format.

Correction: duedate needs to be specified in the server format provided by the jira.date.time.picker.java.format found only in the jira-application.properties file. The shipped default is d/MMM/yy

Edited by: bob.swift on Apr 30, 2009 10:50 AM

Edited by: bob.swift on May 2, 2009 8:57 PM

Brian Esserlieu

Posts: 33
Registered: 04/22/09
Re: JiraSoapService updateIssue parameters
Posted: Apr 30, 2009 5:12 PM    global.in_response_to.tooltip in response to: Ali Ibrahim
Click to report abuse...   Click to reply to this thread Reply
This is what I did (with Perl, not sure what language you were trying to use)

my $soap = SOAP::Lite->proxy("http://server:port/rpc/soap/jirasoapservice-v2?wsdl");
my $auth = $soap->login("login", "password")->result(); #this is my 'token', pass it in to any JIRA SOAP methods: $auth;

my $customfields = $soap->getCustomFields($auth)->result();
my $customfieldid = "";
my $customfieldTarget = "Old ID";
my $target_issue = "TRN-17";
my $customfield_value = "THIS IS THE OLD ID: uploaded with PERLY goodness.";

foreach my $customfield (@{$customfields})
{
if ($customfield->{"name"} eq $customfieldTarget)
{
$customfieldid = $customfield->{"id"};
last;
}
}

my $ref = bless( {
'id' => $customfieldid,
'values' => SOAP::Data->type( string => $customfield_value ),
}, 'RemoteFieldValue' );

my $updatedIssue = $soap->updateIssue($auth, $target_issue, $ref );

print Dumper( $updatedIssue->fault() );
print Dumper( $updatedIssue->result() );

Edited by: Rangent on Apr 30, 2009 5:13 PM

Edited by: Rangent on Apr 30, 2009 5:14 PM
Royce Wong

Posts: 53
Registered: 06/26/07
Re: JiraSoapService updateIssue parameters
Posted: Jun 1, 2009 1:32 PM    global.in_response_to.tooltip in response to: Brian Esserlieu
Click to report abuse...   Click to reply to this thread Reply
In Perl, how do I update... say the assignee field since it is not a custom field and doesn't has a custom field ID?

Edited by: Royce Wong on Jun 1, 2009 1:33 PM
Legend
Genius: 1000 - 10000 pts
Expert: 500 - 999 pts
Guide: 250 - 499 pts
Enthusiast: 50 - 249 pts
Newbie: 5 - 49 pts
Atlassian Employee
Atlassian Partner
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums