Jira : Query inside linkedIssues - jira

We create jiras for tracking a release in a separate project. For eg: there is a project called Release and there will be jiras like Release-1, Release-2, Release-3. The actual code jiras for each release are linked to the release jira- something like Dev-1,Dev-2 linked to Release-1, Dev-3,Dev-4 linked to Release-2 etc. Each release jira has a type defined. I want to find all the dev jiras that are linked to the release jiras which has type say "XYZ". How can i achieve that? Tried out issue in linkedIssues() but its not working.

Is your issue related to this: I cannot run issueFunction in JQL
If you mean "issues" by "jiras"
then please refer to the following example:
Jira Project Release
Release-1 > linked to Dev-1, Dev-2
Release-2 > linked to Dev-3, Dev-4
Jira Project Dev
Dev-1 (bug) > linked to Release-1
Dev-2 (story) > linked to Release-1
Dev-3 (bug) > linked to Release-2
Dev-4 (story) > linked to Release-2
Say I want to query all the bugs in Dev project related to Release-1. Please take note that you will need to have the Adaptavist Scriptrunner Jira plugin.
issueFunction in linkedIssuesOfAll("issue in (Release-1)") and type = Bug

Related

How to list all available jenkins plugins using command list with their short names

I want to list all available plugins names and their short names using command line option, so that I could automate required plugin installation through jenkins command line.
Kindly advise. Thanks
So far I tried to find answer on same however I got answer only for how to list installed plugins, not for all available plugins.
I've found this link http://updates.jenkins-ci.org/download/plugins/ which lists all plugins but with their short names only
You were so close! The LAYOUT is detailed here. The information is nearby for you to parse, hopefully I got it right.
http://updates.jenkins-ci.org/download/plugins/ is indeed the location of the plugins, with the actual plugin versions sitting inside each folder.
https://updates.jenkins.io/ is the root level. You will find the list of all plugins and details at plugin-versions.json.
update-center.js, update-center.json, and update-center.json.html contain actual update center metadata in JSON, JSONP, and HTML format respectively. You can parse the json to pull everything you are looking for. There are also lists for the documentation url and the release history, as well as the updates.
This is where it's nuanced; there's stable (ie:LTS) or latest (ie:weekly) and major releases of each. Each one has its own sublist, depending on minimum version and compatibility.
Plugin Selection
Since none of this tells you what the plugins actually do, the best thing is to choose your plugins at https://plugins.jenkins.io/. Clicking on any plugin (eg: mailer) reveals a header block with details:
Mailer 1.23
Minimum Jenkins requirement: 1.642.3
ID: mailer
The ID is the short name you are looking for. Go through and find the plugins you want to use and that's your list. Don't worry about the dependencies.
About Plugin Management
Even on a standalone instance, I use a modified script of Docker install_plugins.sh to generate the full list of plugins to install .
Update 2021: As part of GSOC 2019 and refined in GSOC 2020, a new and quite functional Plugin Installation Manager CLI Tool has been introduced to replace all non-GUI plugin mgmt tools, including inatall_plugins.sh. Achieves similar results.
You can examine the outputs or use the groovy script that follows to simplify your "must have" list. Also, as dependency updates happen all the time, I also generate a list of actual installed updates if I need to reapply identically to a different instance rather than from my curated list. My curated list is ~45 plugins, with over 115 getting installed.
eg: workflow-api includes [workflow-scm-step] which includes [git, subversion], so no need to specify git. But you want to know which version you got. Occasionally you may need to explicitly add a dependency to get the latest to avoid a defect, per JENKINS-54018, plugins which were split from Jenkins.
println "Jenkins Instance : " + Jenkins.getInstance().getComputer('').getHostName() + " - " + Jenkins.getInstance().getRootUrl()
println "Installed Plugins: "
println "=================="
Jenkins.instance.pluginManager.plugins.sort(false) { a, b -> a.getShortName().toLowerCase() <=> b.getShortName().toLowerCase()}.each { plugin ->
println "${plugin.getShortName()}:${plugin.getVersion()} | ${plugin.getDisplayName()} "
}
println""
println "Plugins Dependency tree (...: dependencies; +++: dependants) :"
println "======================="
Jenkins.instance.pluginManager.plugins.sort(false) { a, b -> a.getShortName().toLowerCase() <=> b.getShortName().toLowerCase()}.each { plugin ->
println "${plugin.getShortName()}:${plugin.getVersion()} | ${plugin.getDisplayName()} "
println "+++ ${plugin.getDependants()}"
println "... ${plugin.getDependencies()}"
println ''
}
return

Cocoapods Quality Indexes : "tested" label not checked

I have an SDK published with cocoapods.
Recently I made an update including a testing target.
Normally I should see the label tested checked but that doesn't happen. I double checked that the target is shared.
So my question here, Is there something special to add in Podspec ? Did they use some CI tools like TravisCI or jenkins to test the project.
I can't find something useful in the official documentation
https://guides.cocoapods.org/making/quality-indexes.html
After some researches, I found the answer in cocoapods source code :
Apperantly they are only checking the label if the pod has more than 5 tests which is not my case.
Check it here :
https://github.com/CocoaPods/cocoapods.org/blob/master/views/pod.slim#L9
has_tests = #cocoadocs["total_test_expectations"] > 5
tested_description = #cocoadocs["total_test_expectations"] > 20 ? "Tested" : "Well Tested"

CC.NET Checkout Based on TFS Label

How do you pull code based on a build label from Team Foundation Server in CruiseControl.NET.
<sourcecontrol type="vsts" autoGetSource="true" applyLabel="true">
<server>http://tfs.internal.com:8080/</server>
<username>*********</username>
<password>*********</password>
<domain>corp</domain>
<project>$/Code</project>
<workingDirectory>D:\BuildServer\Lane1\SourceCode\</workingDirectory>
<cleanCopy>false</cleanCopy>
</sourcecontrol>
According to the documentation for CruiseControl.NET TFS plugin (from codeplex):
<sourcecontrol type="vsts" autoGetSource="true" applyLabel="true">
<server>http://my_team_foundation_server:8080</server>
<username>my_user</username>
<password>my_password</password>
<domain>my_domain</domain>
<project>$/Foobar</project>
<workingDirectory>c:\projects\Foobar</workingDirectory>
<cleanCopy>false</cleanCopy>
<workspace>my_workspace_name</workspace>
<deleteWorkspace>false</deleteWorkspace>
</sourcecontrol>
I do not see this as an option.
I did look at the general TFS sourcecontrol block documentation here and you may be able to use as a way to passing the label as a parameter to the executable. I have not ever tried that with Visual Studio but maybe you can figure out what if you can use dynamicValues as a parameter for specifying your label against the compiler. If not, I do not think CruiseControl.NET can support these TFS features.

TFS 2010 no longer associating changesets with builds

Our TFS 2010 server has stopped associating change sets with builds and i cant for the life of me figure out why.
All the current builds are in a status of 'Build Succeeded'
the build definition has both the 'associate changesets and work items' and 'label sources' set to true.
The build goes through just fine
I've checked ...
the source control history for the solutions and they all have labels assigned associated with the build number
the diagnostic version of the log shows...
Final Property Values
AgentSettings = Use agent where Name=* and Tags is empty; Max Wait Time: 04:00:00
AssociateChangesetsAndWorkItems = True
BuildNumberFormat = IQ_$(Date:yyyyMMdd)$(Rev:.r)
BuildSettings = Build 2 project(s) for 1 platform(s) and configuration(s)
CleanWorkspace = All
CreateLabel = True
CreateTriggerFileList = False
CustomArguments =
and no errors relating to labels that i can see.
I've tried...
deleting the build definition and setting it up again
Any help would be appreciated, I'm just not sure where to start looking next.
Thanks
Aidan
Aidan,
You should be looking for the following item in your workflow template:
Make sure that this has not been tampered with, and if it has, correct the changes. As others have said, check the history in source control for the workflow template file.

TFS 2010 Issue with tracking Changesets in Builds that are a result of Gated Checkins

In order to retrieve the information which Changeset was included in which Build, we use "Label Sidekick" of Team Foundation Sidekicks, where we place the Label of the Build & expect to find the newly built Changeset.
Our development process in TFS 2010 is making use of 'Gated' checkins, so we are faced with the situation that the latest checkins are not presented in Sidekicks (we actually receive the changeset of the previous build). This is explainable, since at the time the labeling takes place, the latest changes have not yet been committed.
The BuildLog does report the associated Changeset correctly.
I 've made several experiments in our Build Process Template but can't seem to get what we need.
Placing, for example, the Labeling activity out of the "Run On Agent" scope, lead me to a build that fails at the very start with an "Object reference not set to an instance of an object." (I suppose this is related with fact I had to widen the scope for 'Label' & 'Workspace' variables to get the second part running).
The 'before' state of the build process template for this attempt is here (this works), the 'after' state ("Object ref not set..") is here.
So, to summarize, two different types of input could help me out:
How should I change our build process template so that the labeling happens after the Gated checkins have been committed? (-- This would rationalize the display in Sidekicks)
or
How can I programmatically retrieve the associated Changeset of each Build? (-- This would enable me to write a small app that could obsolete the Sidekicks angle)
You can use the TFS API to get this done.
public static void GetBuild()
{
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://tfsdevlonuk:8080/tfs/gazprom.mt"), new UICredentialsProvider());
tfs.EnsureAuthenticated();
var buildServer = tfs.GetService<IBuildServer>();
// Get Project Name
var versionControl = tfs.GetService<VersionControlServer>();
var teamProjects = versionControl.GetAllTeamProjects(true);
// Get Builds for a team project
var buildDetails = buildServer.QueryBuilds(teamProjects[0].Name);
// For each build
foreach (IBuildDetail buildDetail in buildDetails)
{
// Get the build details
var buildInfor = buildDetail.Information;
// More build infor like shelveset, etc
Debug.Write(buildDetail.LabelName + buildDetail.ShelvesetName);
}
The above code will help you get the build details programatically. I have some blog posts on how to connect to tfs programmatically and use the tfs api. http://geekswithblogs.net/TarunArora/archive/2011/06/18/tfs-2010-sdk-connecting-to-tfs-2010-programmaticallyndashpart-1.aspx

Resources