I am looking for a code example of creating a Jira Project using SOAP and PHP.
Thank you.
Community moderators have prevented the ability to post new answers.
Hi Steve,
I have created this PHP code somewhile ago to fetch some projects from JIRA, you may change the URL and the request type to add new issues :
<?php $username = 'test'; $password = 'test'; $url = "https://xxxxx.xxxxxxx.net/rest/api/2/project"; $ch = curl_init(); $headers = array( 'Accept: application/json', 'Content-Type: application/json' ); $test = "This is the content of the custom field."; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); $result = curl_exec($ch); $ch_error = curl_error($ch); if ($ch_error) { echo "cURL Error: $ch_error"; } else { echo $result; } curl_close($ch); ?>
Please look here for more information regarding REST API:
http://docs.atlassian.com/jira/REST/latest/
Cheers,
Omar
Tks for the example Omar, but I was looking for a method to add a new Project, not an issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<?php $admin = 'username'; $password = 'password'; $soapClient = new SoapClient('http://urlhere:8080/rpc/soap/jirasoapservice-v2?wsdl'); $token = $soapClient->login($admin,$password); try{ $soapClient->createProject($token, 'KEY' , 'projectname' , 'Description' , 'URL' , 'lead', array('id' =>'permission scheme id'), array('id' =>'notification sheme id') ); } catch(Exception $ex){ die('JIRA add Project failed: ' . $ex->getMessage()); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve, Did you find a method to create Jira Project using php with curl or http-streams?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you look hard enough, you find this method:
RemoteProject createProject(java.lang.String token,
java.lang.String key,
java.lang.String name,
java.lang.String description,
java.lang.String url,
java.lang.String lead,
RemotePermissionScheme permissionScheme,
RemoteScheme notificationScheme,
RemoteScheme issueSecurityScheme)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tks for your reply Timothy. I did find that method in the API documentation. I am looking for an example of how to implement it with PHP. Perhaps someone has PHP code to share as an example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.