New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: JRA-13233
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Alex Schultz
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

Implement transition issue through workflow with XML-RPC

Created: 02/Aug/07 08:26 AM   Updated: 06/Nov/07 12:30 PM
Component/s: Remote API (SOAP & XML-RPC)
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Participants: Alex Schultz, Anton Mazkovoi [Atlassian], Nick Menere [Atlassian] and Royce Wong
Since last comment: 42 weeks, 1 day ago
Labels:


 Description  « Hide
When creating an issue in JIRA remotely through the XML-RPC interface, the status field is not set correctly even when a valid ID (as a string) is pointed to by the "status" key in the Hashtable the createIssue method creates the new issue based on. Likewise, the same problem exists in updateIssue - the status field of the passed Hashtable is being ignored and the status is set automatically to "1" (Open).

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Anton Mazkovoi [Atlassian] added a comment - 03/Aug/07 04:17 AM
Alex,

It should not be possible to change iisues status using create or update operations. The same is true when you use the web interface. An issue's status can only be changed by transitioning the issue trhough workflow.

This is currently possible with SOAP in JIRA, but not with XML-RPC.

Cheers,
Anton


Royce Wong added a comment - 04/Nov/07 08:22 PM
Alex,

Is there any SOAP API sample code for changing issue's status via workflow transitioning?


Nick Menere [Atlassian] added a comment - 04/Nov/07 10:11 PM
Royce, the latest Soapclient can be found at:
https://svn.atlassian.com/svn/public/atlassian/jira-soapclient/tags/atlassian_jira_3_11/src/java/com/atlassian/jira_soapclient/SOAPClient.java

In particular you are after:

    public void testProgressWorkflow(String issueKey)
            throws java.rmi.RemoteException
    {
        System.out.println("Progressing workflow of "+issueKey+"...");
        RemoteNamedObject[] availableActions = jiraSoapService.getAvailableActions(token, issueKey);
        String actionId = null;
        for (int i = 0; i < availableActions.length; i++)
        {
            RemoteNamedObject availableAction = availableActions[i];
            System.out.println("availableAction: " + availableAction.getId() + " - " + availableAction.getName());
            if (actionId == null) actionId = availableAction.getId();
        }

        if (actionId != null)
        {
            RemoteField[] fieldsForAction = jiraSoapService.getFieldsForAction(token, issueKey, actionId);
            for (int i = 0; i < fieldsForAction.length; i++)
            {
                RemoteField remoteField = fieldsForAction[i];
                System.out.println("remoteField: " + remoteField.getId() + " - " + remoteField.getName());
            }

            RemoteFieldValue[] actionParams = new RemoteFieldValue[]{
                    new RemoteFieldValue("assignee", new String[]{ClientConstants.LOGIN_NAME})
            };

            RemoteIssue remoteIssue = jiraSoapService.progressWorkflowAction(token, issueKey, actionId, actionParams);
            System.out.println("Progressed workflow of "+remoteIssue.getKey()+" to: " + remoteIssue.getStatus());
        }
    }

Cheers,
Nick


Anton Mazkovoi [Atlassian] added a comment - 04/Nov/07 10:19 PM
Hi Royce,

If you have further questions please ask on JIRA Dev Forum or create a support request in our support system:
http://support.atlassian.com

Cheers,
Anton


Royce Wong added a comment - 06/Nov/07 12:30 PM - edited
Thanks Anton and Nick. I got the workflow transition working.