Rename a job in jenkins - jenkins

How to go about renaming a job in jenkins?
Is there another way than to create a new job and destroying the old one?

In Jenkins v2, in your dashboard or job overview, click right button on the job and select rename:

In the version we're running (1.480) it is simply a matter of changing the Project name in the Configure menu and hitting Save afterwards.
Cheers,

In New Jenkins, Click Rename link present in the left navigation pane, Update the job name and click save.

Simply change the name in the Pipeline/Project name and hit save.
Note that if your browser window isn't wide enough the "popup" below will be offscreen so make sure you scroll down or your jobs may mysteriously not rename.
"Are you sure about renaming old-job to new-job?"

Use the "Configure" option to the left:
Example showing Configure option
(Sorry, first few posts so I'm not able to post images in directly yet!)
If you can't see this then make sure you have access rights - in other words, you may need to be logged in, and you will need privileges that allow you to administer that job/pipeline.

Related

How to promote a Gerrit draft submission to a regular code-review submission

A colleague sent me a Gerrrit code review "draft" (I suppose via "refs/drafts/master" instead of "refs/for/master") and then left on holiday. Without downloading the patch and submitting it myself, how can I promote his draft to a full regular code-review so I can approve it & submit it for merging?
I think this is a similar question, but it's for git-review, not Gerrit. Also I'm interested in doing it from the Gerrit web GUI if at all possible. And I don't see a "Publish" button on my Gerrit web GUI for that draft. (And currently it doesn't say anything about merge conflicts, as long as I hurry....)
If I click on the "Patch Sets" link in the top right of the GUI, this is what I see:
In the top left it says "Change 58358 - Draft", and in the middle of the window it shows this:
Only the change owner can publish a draft patch set. Using the UI's cherry-pick option as described in other answers won't work because the cherry-pick implementation preserves the draft status on the new change or patch set.
As far as I know the only way to force the change into NEW state is to manually download the commit and push a new patch set using refs/for/master instead of refs/drafts/master.
Note that if you're not rebasing the change onto a new parent at the same time, you might need to slightly edit the commit message to make gerrit accept it. Otherwise it'll reject with no new changes.
If your colleague add you as reviewer, you can. You can cherry-pick this commit.
Click on download link at the right-top corner, and there are aliases for commands above.
But as you updated your question, you don't want to check out and manually push or cherry pick to master branch. You can use cherry-pick\merge button on ui, if you are confident in this mr, and it should be on master branch. Also you can publish this commit for other reviewers.
p.s. updated (you can cherry-pick, merge, publish via UI)
Do the following procedure:
1) Go to the draft change page
2) Click on Cherry Pick button
3) Write "master" in the Cherry Pick to Branch field
4) Adjust the Cherry Pick Commit Message if needed
5) Click on Cherry Pick Change button
It'll be created a NEW CHANGE cherry-picked from the draft change. Go to the new change page and follow the regular Gerrit process (review, approve, submit). The original draft change can be abandoned or deleted.

Unable to create 'new job' in jenkins, OK button greyed out

I am trying to create a new job in Jenkins. Even after giving 'item name' and type of project as 'freestyle', the 'OK' button is greyed out as shown in the attached screenshot.
I am using :
Windows 7 32 bit OS
Jenkins version 1.619
Can anyone tell how to solve this issue.
Thanks in advance.
Check if the problem is related to your particular browser configuration.
Try with addons/plugins disabled, or in another browser.
Check the Jenkins logs under the logs folder to see if there's anything meaningful.
As the "People" tab in Jenkins says, it "Includes all known “users”, including login identities which the current security realm can enumerate, as well as people mentioned in commit messages in recorded changelogs."
To ensure that you have been assigned with appropriate role, ask a person with admin or dev rights, to go to Manage Jenkins -> Manage and Assign Roles -> Assign Roles, and then add you as user with appropriate rights.
Easy way to fix this issue
Before :
The OK button is disabled:
After :
Choosing any items and then OK will enable:

Auto assign to team lead/developer on bug reopen

In my implementation of JIRA, I have a custom field called Developer which gets populated automatically (username) whenever someone move the JIRA from Open to Fixed state. Now I want something similar for the Fixed to Reopen transition. That is, whenever the tester changes the status to Reopen, it should go back to the Developer or the Project Lead (in case the field isnt populated as the custom field can be overridden).
I tried to implement a post function, but there isn't a way where I can use OR criteria. Or is there a way?
You can do a Post Function on the transition using the Script Runner plugin if its a self-hosted JIRA instance which will allow you great flexibility in the logic to fill the target field in.
I finally managed to find a workaround for this.
Download the Workflow Enhancer for JIRA plugin (FREE). You would also need JIRA Suite Utilities (I had it installed already for some other customization)
In the Fixed to Reopen transition, add a Post Function and use Copy Value From Other Field to update Assignee from Developer field
Then add another Post Function underneath this where you need to use Universal Post Function. Here make the boolean condition as {Assignee}=="" and select Choose post function to execute: as Assign to Lead Developer
Publish the draft.

Moving Jobs in Jenkins

So I have been asked to create a job on a Jenkins system that is on the university servers. The problem is I was asked to create it in a specific folder. However I accidentally created in the root folder. Is there a way to move the job from the root to the specific folder or do I have to delete it and create a new one?
There is a move option on the GUI:
Stand on the little triangle near the job you want to move/copy/delete, and on the popup menu - choose the wanted operation. On move you can move to another folder.
But, There is also an open issue about this (opened on 2016):
https://issues.jenkins-ci.org/browse/JENKINS-35093
I had to restart Jenkins after doing it to a job with some history.
So maybe re-create/copy and delete is a better solution (but no history is saved).
Go to your job's configuration page and from 'Advanced Project Options' check 'Use custom workspace'. Enter the path of the directory where you want the files to be created.

How to remove a user from Jenkins

I have many users in Jenkins that have automatically come from SVN. One of our developers left the project and I removed him from the SVN. However, his contacts are not removed from Jenkins and I cannot find a place in Jenkins where I could remove users from. Any ideas on how to remove users from Jenkins?
I couldn't find the delete option. I went here and found a relevant but unhelpful answer. So I just tried:
http://<jenkins.url>/user/<username>/delete
I got redirected to an existing page \o/ There was a button asking to confirm the deletion. I clicked and the user was removed.
Hope this helps
PS: I just found how to do it right: Go to "Manage Jenkins" > "Manage Users" and click the delete button on the same row (far right) of the user you want to delete
I believe you need to remove or replace the user from, all the times they exist, in the build.xml file(s) which are under the jobs directory then the name of the job and the builds directory.
If you go to the People view, you can click a user and then choose Delete in the left-hand menu (if you have Administer access).
You could also delete the folder [jenkins-root]/Users/[username] and re-start Jenkins.

Resources