Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = '******';
- $password = '*****';
- $url = "https://jira.*****/rest/api/2/search?jql=****";
- $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 {
- $phpData = json_decode($result);
- foreach($phpData->issues as $issue){
- print_r($issue)
- }
- }
- curl_close($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement