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.issues
for (i = 0; i <issues.size(); i++) {
def result = jiraGetIssue idOrKey: issues[i].key
string SS = result.data.key
echo result.data.key
GIT_COMMIT_HASH = sh (script: 'git log --pretty=format:"%h;%s" --no-merges | grep "'+ SS +'"' , returnStdout: true)
echo "${GIT_COMMIT_HASH}"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.