is it possible use SOAP api via php?

fabby August 1, 2012

i want to release versions programmingly using php in jira.

i only find JAVA,Python,Ruby is possible (https://confluence.atlassian.com/display/JIRA042/Creating+a+SOAP+Client)

anyone can tell me is it possible for php and give me some example code?

2 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
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
August 1, 2012

JIRA Command Line Interface would be easier.

fabby August 1, 2012

hi,Bob

my jira version is 4.4.1

is it possible to move issues to next version when there are some unresolved issues?

and which is the suitable CLI version ?

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
August 1, 2012

Use the latest CLI release. I would recommend use you runFromIssueList with a JQL query for all the issues that are in the version you want to release, but are not resolved. The action to run from the list would be updateIssue setting the fixVersions to some other version. See How to use runFromIssueList for more details.

fabby August 2, 2012

hi,Bob

my jira instance is installed on window server 2008.and i want to access jira use CLI on one linux machine.

then i download jira-cli-2.6.0,and in jira.sh file ,i modify it like below:

#!/bin/bash

# Comments
# - Customize for your installation, for instance you might want to add default parameters like the following:
 java -jar `dirname $0`/home/ycc/jira-cli-2.6.0 --server http://192.168.80.xxx:8079 --user jiaruser --password jira "$@"

#java -jar `dirname $0`/lib/jira-cli-2.6.0.jar "$@"

and the problem is,when i run the CLI command like "jira --action releaseVersion --project "zjiracli" --name "V1" --dateFormat "yyyy.MM.dd"". it says can't find the command 'jira'

fabby August 2, 2012

modify java -jar `dirname $0`/home/ycc/jira-cli-2.6.0 --server http://192.168.80.xxx:8079 --user jiaruser --password jira "$@"

to

java -jar `dirname $0`/lib/jira-cli-2.6.0.jar --server http://192.168.80.xxx:8079 --user jiaruser --password jira "$@"

will resolve it.

but i find the other error,the command releaseVersion seems can not change the release date !

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
August 2, 2012

You need to specify the --date parameter in the date format you provided to set the release date.

fabby August 3, 2012

thanks ! it's a wonderful tool. and easier to use!

0 votes
Leroy Elendt August 1, 2012

Yes it is possible and not too hard to make it happen. I attached some code I've written for creating a space:

<?php

//used for creating a space
class Space {
	public $key;
	public $name;
	public $description;
	public $homePage;
}

$confURL="http://yoururlhere.com";

$user = "user";
$password = "password";

$key = "New";
$name = "NewSpace";
$description = "Die Description für den Space";
$groupName = strtolower($key); //has to be lowercase


$client = new SoapClient($confURL."/rpc/soap-axis/confluenceservice-v2?wsdl", 
	array('location' =>$confURL."/rpc/soap-axis/confluenceservice-v2", 'uri' => $confURL."/rpc/soap-axis/confluenceservice-v2"));
try{
	//get Auth-token
	$token = $client->login($user, $password);	

		//addSpace with defined values
		$client->addSpace($token, $newSpace);
		

		
}catch (SoapFault $ex){
	print ("Fehlercode: " . $ex->faultcode ."<br/>");
	print ("Fehlerstring: " . $ex->faultstring);
}



?>

TAGS
AUG Leaders

Atlassian Community Events