Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL to find the no of code commits, pull request associated with each issue

prabu m November 6, 2019

issues that have code commit we can use the below JQL

development[commits].all > 0

How can I find the no of code commits, in each issue Like (JIR-100 - 3 commits, 1 pull request, and JIR-101 - 2 commits, 1 pull request)

1 answer

0 votes
Muhammad Ramzan_Atlassian Certified Master_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2019

For that you need SQL query  like below

 

SELECT
project.name AS "PROJ_NAME",
project.project_key AS "PROJ_KEY",
repository.name AS "REPO_NAME",
repository.slug AS "REPO_SLUG",
sta_pull_request.id AS "PR_ID",
sta_pull_request.title AS "PR_TITLE",
cs_attribute.att_value AS "JIRA_KEY"
FROM
sta_pull_request
INNER JOIN repository ON (sta_pull_request.from_repository_id = repository.id) OR (sta_pull_request.to_repository_id = repository.id)
INNER JOIN project ON (repository.project_id = project.id)
INNER JOIN cs_attribute ON (sta_pull_request.from_hash = cs_attribute.cs_id) OR (sta_pull_request.to_hash = cs_attribute.cs_id)
WHERE cs_attribute.att_name = 'jira-key';
prabu m November 7, 2019

@Muhammad Ramzan_Atlassian Certified Master_  Thank you, we are using cloud version, let me know how can I use SQL query in that?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events