Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,612
Community Members
 
Community Events
185
Community Groups

Ticket status report on internal website

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.

1 answer

1 accepted

0 votes
Answer accepted

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;
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events