You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have a requirement from my team to show the status of tickets for a certain ticket type on an internal webpage.
I need to display the tickets in the form of a table
Status, Key, Created Summary, Reporter, Assignee, Customfield1, Customfield2
I need to show these tickets for a date range eg all tickets for April or all tickets for May.
In the past, we were manually exporting these tickets with Excel and saving them to a PDF on to a network drive but "Ain't Nobody Got Time for That"
I am not sure how I could go about creating something like this so I wanted to post here to get some ideas on how this could be achieved. Happy to look at code, plugins, powerbi or anything else that could automate this.
I ended up doing something like this
// Jira Service Management Cloud REST API URL
$url = "https://yoursite.atlassian.net/rest/api/2/search";
// API key for authentication
$api_key = "1234";
// Request parameters
$params = array(
"jql" => "queue = 10018",
"maxResults" => 1000,
"fields" => array(
"status",
"key",
"created",
"summary",
"reporter",
"assignee",
)
);
// Add month filter if specified
if (isset($_GET['month'])) {
$params['jql'] .= " AND created >= '".$_GET['month']."-01' AND created <= '".$_GET['month']."-31'";
}
// HTTP headers
$headers = array(
"Authorization: Basic ".base64_encode($api_key.":".$api_key),
"Content-Type: application/json"
);
// HTTP request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url."?".http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Parse JSON response
$data = json_decode($response, true);
// Extract ticket data
$tickets = array();
foreach ($data['issues'] as $issue) {
$ticket = array(
"status" => $issue['fields']['status']['name'],
"key" => $issue['key'],
"created" => $issue['fields']['created'],
"summary" => $issue['fields']['summary'],
"reporter" => $issue['fields']['reporter']['displayName'],
"assignee" => $issue['fields']['assignee']['displayName']
);
$tickets[] = $ticket;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.