One thing that Atlassian’s Jira does not allow is the posting of tasks to multiple recipients. So the below is a snippet that shows how to create and post JiraJelly scripts using cURL within PHP.
Note, on the calling page I used ldap_connect to query our AD database for a list of users. A little html and jQuery allowed the user to select the required users from the list, and input the required fields for the Jira task.
I then use some basic PHP to create some XML in the form of:
<JiraJelly xmlns:jira='jelly:com.atlassian.jira.jelly.JiraTagLib'>
<jira:CreateIssue
project-key='<project key>'
assignee='<assignee>'
priority='<priority>';
summary='<summary>'
reporter='<reporter>'
description='<some description>'>
</jira:CreateIssue>
</JiraJelly>
Next, the cURL:
$username='<user>';
$password='<password>';
$base_url= "http://<your Jira server>/jira/secure/
admin/util/JellyRunner.jspa";
$params="os_username=$username&os_password=
$password&Run=Run&filename=&
script=" . urlencode($<your XML string>);
$curl = curl_init();
curl_setopt($curl,CURLOPT_HTTPHEADER,array('
X-Atlassian-Token: no-check'));
curl_setopt($curl,CURLOPT_RETURNTRANSFER, false );
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, true );
curl_setopt($curl,CURLOPT_URL, "$base_url?$params");
curl_exec($curl);
curl_close($curl);
Now all you need is to fill in the variables and you’re up and running.
Hope this helps someone out there!











