Pipeline job builds not being recorded in JIRA issue
Description
Environment
Attachments
- 23 Sep 2016, 09:32 PM
- 23 Sep 2016, 09:32 PM
relates to
Activity
Mark Rekveld October 27, 2016 at 3:55 PM
The new changeSets
field is now being mapped and this should resolve this issue
Derek N September 23, 2016 at 9:33 PMEdited
Thanks, Mark.
Yea i noticed that this [...] showed up for the pipeline job build:
2016-09-21 14:38:50,536 JenkinsConnectorExecutorServiceThread:thread-2 DEBUG [o.m.j.p.j.sync.impl.JobSynchronizationOperation] Found [] related to Build[id=167,jobId=33,number=4,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
And the freestyle job built a little later that had the same new commit that was built by the above pipeline build has the issue ID TP-8 (along with the previous 2 commits.. i had pushed 3 new commits since the previous freestyle job build):
2016-09-21 14:42:38,599 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.sync.impl.JobSynchronizationOperation] Found [TP-8, TP-7, TP-6] related to Build[id=168,jobId=5,number=11,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
You can see the Jenkins changes/change log screenshots:
Mark Rekveld September 22, 2016 at 8:34 AM
HI,
The mentioning of issue TP-8 in the log is from when a users requested the CI Builds Panel for that specific issue. It will then query the system for any related builds.
During synchronization, you will want to keep an eye on this log statement Found [...] related to Build[id=167,jobId=33,number=4,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
Where ...
is a list of the related issue keys that where found in the builds field that are indexed for issue keys. See the Data Synchronization feature description in the docs for what fields are synchronized.
But doing some debugging, it seems that Jenkins has come up with yet another method of exporting the changeSet through the api/json
endpoints. So I'll have to make an update to plugin to ge tthe changeset to work correctly.
Derek N September 21, 2016 at 10:25 PM
In both the pipeline and freestyle job builds' console, the following message appears after the build:
Notified JIRA that a build has completed.
So it appears that the JIRABuildNotificationListener caught the event.
Any help/hints would be appreciated. Thanks a lot
Derek N September 21, 2016 at 10:18 PMEdited
Here's a trace for my Jenkins freestyle project build with the same commit after the pipeline build. Project name 'jira_test2' and issue key 'TP-8'.
Trace:
2016-09-21 14:42:38,270 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.sync.impl.JobSynchronizationOperation] Synchronizing builds from Job jira_test2
2016-09-21 14:42:38,598 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.sync.impl.JobSynchronizationOperation] Synchronizing Build 11 from jira_test2
2016-09-21 14:42:38,598 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.dao.impl.DefaultBuildDAO] Saving Build[id=0,jobId=5,number=11,cause=Started by user jenkins_user,result=SUCCESS,builtOn=,deleted=false]
2016-09-21 14:42:38,599 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.sync.impl.JobSynchronizationOperation] Found [TP-8, TP-7, TP-6] related to Build[id=168,jobId=5,number=11,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
2016-09-21 14:42:38,600 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.dao.impl.DefaultIssueDAO] Linking TP-8 to Build[id=168,jobId=5,number=11,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
2016-09-21 14:42:38,609 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.dao.impl.DefaultIssueDAO] Linking TP-7 to Build[id=168,jobId=5,number=11,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
2016-09-21 14:42:38,610 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.dao.impl.DefaultIssueDAO] Linking TP-6 to Build[id=168,jobId=5,number=11,cause=Started by user jenkins_user,result=SUCCESS,builtOn=<null>,deleted=false]
2016-09-21 14:42:38,627 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.services.impl.BuildIssueFilterQueryBuilder] Transformed filter org.marvelution.jira.plugins.jenkins.services.BuildIssueFilter@2cf9a10a[inProjectKeys=[],notInProjectKeys=[],inIssueKeys=[TP-8],notInIssueKeys=[],notInUsers=<null>,inUsers=<null>,inJobIds=<null>,notInJobIds=<null>] to IssueMapping where claus: (ISSUE_KEY IN ('TP-8'))
2016-09-21 14:42:38,628 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.services.impl.BuildIssueFilterQueryBuilder] Transformed filter org.marvelution.jira.plugins.jenkins.services.BuildIssueFilter@2cf9a10a[inProjectKeys=[],notInProjectKeys=[],inIssueKeys=[TP-8],notInIssueKeys=[],notInUsers=<null>,inUsers=<null>,inJobIds=[],notInJobIds=[]] to BuildMapping where claus: ID IN (168)
2016-09-21 14:42:38,629 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.jenkins.indexing.JenkinsIssueSearchExtractor] Indexing TP-8 took 2 ms
2016-09-21 14:42:38,649 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.services.impl.BuildIssueFilterQueryBuilder] Transformed filter org.marvelution.jira.plugins.jenkins.services.BuildIssueFilter@57b460ea[inProjectKeys=[],notInProjectKeys=[],inIssueKeys=[TP-7],notInIssueKeys=[],notInUsers=<null>,inUsers=<null>,inJobIds=<null>,notInJobIds=<null>] to IssueMapping where claus: (ISSUE_KEY IN ('TP-7'))
2016-09-21 14:42:38,650 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.services.impl.BuildIssueFilterQueryBuilder] Transformed filter org.marvelution.jira.plugins.jenkins.services.BuildIssueFilter@57b460ea[inProjectKeys=[],notInProjectKeys=[],inIssueKeys=[TP-7],notInIssueKeys=[],notInUsers=<null>,inUsers=<null>,inJobIds=[],notInJobIds=[]] to BuildMapping where claus: ID IN (168)
2016-09-21 14:42:38,664 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.jenkins.indexing.JenkinsIssueSearchExtractor] Indexing TP-7 took 15 ms
2016-09-21 14:42:38,676 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.services.impl.BuildIssueFilterQueryBuilder] Transformed filter org.marvelution.jira.plugins.jenkins.services.BuildIssueFilter@64a9cfdb[inProjectKeys=[],notInProjectKeys=[],inIssueKeys=[TP-6],notInIssueKeys=[],notInUsers=<null>,inUsers=<null>,inJobIds=<null>,notInJobIds=<null>] to IssueMapping where claus: (ISSUE_KEY IN ('TP-6'))
2016-09-21 14:42:38,677 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.j.services.impl.BuildIssueFilterQueryBuilder] Transformed filter org.marvelution.jira.plugins.jenkins.services.BuildIssueFilter@64a9cfdb[inProjectKeys=[],notInProjectKeys=[],inIssueKeys=[TP-6],notInIssueKeys=[],notInUsers=<null>,inUsers=<null>,inJobIds=[],notInJobIds=[]] to BuildMapping where claus: ID IN (168)
2016-09-21 14:42:38,678 JenkinsConnectorExecutorServiceThread:thread-4 DEBUG ServiceRunner [o.m.j.p.jenkins.indexing.JenkinsIssueSearchExtractor] Indexing TP-6 took 2 ms
2016-09-21 14:42:38,710 JenkinsConnectorExecutorServiceThread:thread-4 INFO ServiceRunner [o.m.j.p.j.sync.impl.JobSynchronizationOperation] Marking all builds of jira_test2 prior to 1 as deleted
Any idea why the pipeline job isn't getting recorded? Thanks
Updated to the new Jenkins Integration for JIRA plugins 2.2.0 on my JIRA instance (v7.2.1) and Jenkins (v2.21).
My Jenkins pipeline job gets recognized, can be enabled and the builds can be synchronized to JIRA. However the corresponding issues (CI Builds panel) don't get updated.
For a Jenkins freestyle job, the corresponding issues' CI Builds panel in JIRA do get updated.