Update JIRA custom fields from Jenkins pipeline - jenkins-pipeline

I need to update JIRA custom fields(fix branch and fix versions) with JIRA ID (COPR-50320) from Jenkins pipeline.
Actually, I new to Jenkins. But I have done successful integration of JIRA to JENKINS.
So, I am not clear how to get JIRA issue based on id (I get this id from SVN) and update fields using this id.

Related

github actions workflow workflow_dispatch running a workflow manually - most of the Tags are disabled

I am using github actions workflow for code deployment. One of the flow is manual using workflow_dispatch. I am able to select main or any feature branch but when i select tags - most of them are disabled and gives you below error message:
"Workflow does not exist or does not have a workflow_dispatch trigger in this tag.
Learn more about manual workflows"
If I create a new git tag, i am able to deploy. Please help me by sharing the logic and reasoning. Thanks,
If workflow didn't exist when the tag was created, it's not available. The same goes for branches.
The way to fix it is to either cherry-pick workflow there and move a tag or re-base the tag on top of the master branch.
Also keep in mind if you modify workflow on your master branch, but you have a different version in branches - it will use the branch / tag version.
If you want to keep 1 version across all tags - you should pass a tag as an input variable and run it on master branch instead of running workflow on this tag. Then you just have to modify your checkout-action to checkout the passed tag, not leaving it with defaults.

Jenkins project version in Nexus Repository Manager Publisher plugin

This is my current working setup:
I want to automate these variables:
Is there a way to automate the version number in this build step? E.g. extract it from the root pom.xml?
I already tried putting ${project.version} inside the version field, but that didn't work either. Which placeholder am I required to use here, as the field is a required value and cannot be left empty?
Write ${POM_VERSION} instead of 1.0.0
You can also use ${POM_GROUPID} and ${POM_ARTIFACTID} for the group and for the id of the project.

How to add a custom link in a multibranch Jenkins Pipeline

We are archiving a lot of html reports in a Jenkins pipeline (scripted Pipeline). These are accessible through a link "Last Successful Artifacts" on the job page as usual. But we would like to create an additional custom link that that points to one of these reports (that is being generated whether the build is successful or not).
I found the DocLink plugin, but it's not listed on the pipeline compatibility list and I'm not able to figure out how this eventually could be used in a pipeline.
The HTML Publisher Plugin is another one I was looking at. But it’s not suited for our use case, since it requires us to gather all reports and publish them again. It also puts all the content in an iframe, but all we need is link to one of the already archived html reports.
Here is a example to add summary links to a build
manager.createSummary("document.png").appendText("<a href='"+ pom.url + "'>View Maven Site</a>", false)
As that method accepts HTML and can be used for XSS you need to approve them.
https://jenkins.io/doc/book/managing/script-approval/
for more examples look here: https://wiki.jenkins.io/display/JENKINS/Groovy+Postbuild+Plugin
For pipeline the Badge plugin was extracted from the Groovy Postbuild plugin and if can create the summary using something like:
createSummary icon:'package.png', text: "<a href='$pom.url'>View Maven Site</a>"

Automatic Issue Assignment in sonarQube 5.6.6 - Not working

I'm using sonarqube 5.6.6 and I've installed the sonar-scm-svn-plugin-1.3. The author of the committer is available in the source code. Can any one please describe the step in detail for auto assign the issue to the last committer.
Creating the project name as login credential and adding the SCM account name for the particular project.
Thanks,
Sangeetha k
Make sure sonarqube can perform a mapping between the author of the commit and a user in the sonarqube DB. The field "login" and "email" are automatically taken into account and you can specify additional SCM Accounts.
You could also update the SVN Plugin, the current version is 1.4.0.522.

Issue assign plugin in sonarqube

When configuring issue assign plugin in sonarqube I found examples using the word key.
example - Key: sonar.issueassign.default.assignee
Can you please explain to me how to use this feature and how to use this key to fill the configuration.
The plugin will assign issue to this user, when can not determine who is the author of change. You should fill it with SonarQube user name.
Example:
sonar.issueassign.default.assignee=agabrys

Resources