i need help, how to do a jql in the Jira with the commit hash of Bitbucket, i need get the commit hash and write in the file .txt
You can use development[commits].all to get all issues that have commits associated with them. You would then have to use REST API provided by the integration to get the commit hash, see /rest/jira/1.0/issues/{issueKey}/commits.
Thank's for your answer, but i need run this in the Jenkinsfile, i'm mounting a JQL, and i want show the column with hash commits, example the down.
node {stage('JIRA') {withEnv(['JIRA_SITE=JiraConexao']) {def searchResults = jiraJqlSearch jql: 'PROJECT = SS AND issuetype = Defeito AND status = "Aplicar Pacote" AND Fase in ("Fase 02", "Fase 01")'def issues = searchResults.data.issuesfor (i = 0; i <issues.size(); i++) {def result = jiraGetIssue idOrKey: issues[i].keystring SS = result.data.keyecho result.data.keyGIT_COMMIT_HASH = sh (script: 'git log --pretty=format:"%h;%s" --no-merges | grep "'+ SS +'"' , returnStdout: true)echo "${GIT_COMMIT_HASH}"}}}
Jira doesn't hold the commit information, that is stored in Bitbucket so using JQL only will just get you halfway there. You need to use the REST API that comes with the integration to get the commit hashes.
It looks like you're new here. Sign in or register to get started.