Jenkins choice parameters from a data structure - jenkins

I'm using the extended choice Jenkins plugin to allow a user to choose a group of hosts to run a job against. Right now, it's done in a naive way and each menu item is just a long list of hostnames.
What I'd like instead is something more sensible like a group name that is mapped to a data structure that can be updated easily. So, for example, the menu items would be "Prod", "Stage", etc. Even after reading the docs, I don't understand how to get that behavior with this plugin.

Related

Extended information for nodes in Jenkins

I want to add more information to node/computer/agent entries in Jenkins (listed under <JenkinsUrl>/computer).
minimum for me would be:
URL to a wiki page (clickable)
and optimal would be in addition:
more configurable columns / fields with different types possible
URL
HTML
Text
above fields should be displayed in node/computer overview
Is this configurable in jenkins or are there plugins for that?
Motivation:
We have multiple teams sharing the same Jenkins instance and want to describe some maintenance details accessible from the jenkins node overview (e.g.: who is responsible for maintenance? Where is it hosted? How to get access?).

Is there any way to ask user questions in Jenkins job parameter?

I want to ask user some questions before he/she builds. Questions will be like
Are you sure you have included all the files? (Answers: Yes, No )
Have you created a ticket in JIRA related to this fix? (Answer: Yes, No )
Is there any way I can do it? is there any plugin available for this?
A freestyle job can be configured to build with parameters. See:
https://wiki.jenkins.io/display/JENKINS/Parameterized+Build
You can configure the parameter type (string, boolean, drop down etc), give a description of the parameter and a default value. The job parameters can even include more complex things like validation rules:
https://wiki.jenkins.io/display/JENKINS/Validating+String+Parameter+Plugin
Or groovy scripts:
https://wiki.jenkins.io/display/JENKINS/Dynamic+Parameter+Plug-in
Or values shown in one parameter list change depending on the value of another:
https://wiki.jenkins.io/display/JENKINS/Active+Choices+Plugin
Your user then has to start the job by building with parameters - in effect being shown the parameter and descriptions (a bit like being asked the question).
Further validation can be done before initiating build steps using the 'Prepare an environment for the run' from the:
https://wiki.jenkins.io/display/JENKINS/EnvInject+Plugin
Build steps can be made optional based on user responses using:
https://wiki.jenkins.io/display/JENKINS/Conditional+BuildStep+Plugin
or
https://wiki.jenkins.io/display/JENKINS/Groovy+plugin
I've used all of the above to refine the choices the user has and what gets done with/because of those choices. I'm using Jenkins 2.116 in process of planning for upgrade to pipeline.
you can use input in your pipeline builds, with the questions you interested to provide to user. You can read more of usage in official doc of Jenkins here - https://jenkins.io/doc/pipeline/steps/pipeline-input-step/

TFS Work Items: Workaround for dashboard widgets unable to show tree of work item type queries

We have a work item structure in TFS 2015 (Will soon be upgraded to 2017, in case there are features there which may be relevant) which consists of the usual CMMI template hierarchy: Epic->Feature->Requirement (Where requirement is roughly analogous to PBI in other templates, for those unfamiliar)
We have abstracted the large body of work by making Epic and Feature meaningful. Applying a common analogy, an Epic->Feature->Requirement in this setup for a requirement on a webpage might be [Security]->[Password Management]->[Password Complexity rule xyz]
The main problem is that, while the 'tree of work items' type query is powerful and useful for this setup, some features of TFS only work on flat list of work item type queries, including dashboard widgets. Continuing the example above, if I wanted to create a widget to see how many Security Requirements (PBIs) were completed, I could not do that.
I'm looking for ideas on how to get around this restriction in VS2015 or VS2017, and the best solution I can think of so far is to create a service hook which uses the TFS api to traverse the tree and then copy the title or ID of the parent Epic/Feature onto the Requirement in some dummy field. This seems very clunky and inelegant. Another option would be to mirror the Epic/Feature hierarchy in Areas, but this is quite unfavorable as we use the Area for another purpose and it creates a maintenance problem as they would need to be kept in sync.
There is Query Results and Chart for Work Items widgets that can uses Tree of work items in TFS 2015, but can’t just count the children work items (e.g. Requirements)
You can build a custom widget extension and retrieve the corresponding work items through REST API and count related work items.
There is a sample with detail code of how to retrieve the data through REST API, so you can refer to this article to build a custom widget extension: Add a dashboard widget

How to automatically assign a TFS work item to a particular person/role

I would like to customize a Work Item Type in TFS to automatically set the Assignee to a particular role. For example (to compare to another Issue Tracker), in JIRA the default Assignee is the Project Lead (so that any ticket not otherwise assigned, gets automatically assigned to whatever person is designated in the role of Project Lead). Can I do something similar in TFS?
So, I realize that one difference between JIRA and TFS is that TFS doesn't (to my knowledge) have the concept of "Roles". The closest thing to that is "Groups", but unlike Roles, Groups can have multiple people (which may be the restricting factor in this problem). I know how to configure a TFS Work Item so that only a certain Group gets listed in the "Assign To" field, but I would like to go a step farther, if possible, and create a custom Group with just one member (e.g., "Issue Guru") and then set up the work item to get automatically assigned to that person.
I'm trying to replicate the Jira functionality here, and maybe there is just no good way to do it in the TFS framework. Any suggestions?
There's a Step by Step Guide on Ivan Fioravanti's Blog for enabling it.
If you are unfamiliar with customising Work Item Types, have a look at the following links (stolen from Grant Holliday's blog).
I never tried this in production but here is something I tried quickly and it seems like it could work.
You can set the default value to a Group by editing work item template in template editor.
Just select Assigned to field and add a DEFAULT rule like shown in the image below.
This will also require you to create one or more groups (one global or maybe one per project). Once you set this up you won’t have to make any updates in the future but only manage people who are in the groups.

Where best to create company wide groups in OFBiz?

I am trying to create branches of a company (and then hopefully teams within branches) in Ofbiz. I had a look at the HR app, and whilst it does list a company and some departments and other stuff in the main view, I haven't been able to find a way to modify this org tree to remove or add to it. The only thing I can think off is to delete/modify this information in the DB, but I'd rather not resort to such tinkering (if it is indeed actually possible to do it this way)
This can be done with Relationsships in the Partymanager application.
(See https://localhost:8443/partymgr/control/EditPartyRelationships?partyId=Company if you're running a local default installation)

Resources