How to create a label in TFS/TFVC using the REST API? - tfs

I know how to create a label in TFVC from within Visual Studio. I know the REST API can query for labels. But how do I create a label using the REST API?
Microsoft documentation does not cover it: https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/labels
Thanks!

Currently we cannot create a label using the REST API, just as you mentioned, according to the official documents this feature is not supported.
However you can create a label using TFS API with VersionControlServer.CreateLabel Method, See below sample for your reference:
http://blogs.microsoft.co.il/shair/2011/06/14/tfs-api-part-38-create-label/
https://searchcode.com/codesearch/view/10043190/
Besides, you can also create a label with the Label Command
eg:
The following example uses the scope option to apply a label to 314.cs.
c:\projects>tf label goodbuild#$/TeamProject1 314.cs

Related

How to link other JIRA dashboards to a central dashboard?

I have several dashboards in JIRA and want to create a central one where there is a filter or gadget that will display links to the other dashboards. Is this possible?
You may save all of these dashboards' URLs and show them inside a gadget in your main dashboard.
Let's say one of your "other dashboard"s link is: your-jira-url.com/secure/Dashboard.jspa?selectPageId=10000
Then, you can add a new gadget (like Text plugin which can show HTML) and add following HTML in that gadget:
Link to the other dashboard
However, Text plugin is not enabled default because of the security issues. You may find the details on Atlassian documentation.
Also, as an alternative, you may try HTML for Jira plugin, or you may find some free alternatives from Marketplace.
I found a way to accomplish this. You can embed it in a issue ie the description field and use a filter to display that field of that issue

Is it possibile to show a label next to the corresponding field with the workitem web layout of DevOps 2019?

I'm upgrading my custom process template from TFS 2017 on premises to DevOps Server 2019 on premises.
In TFS 2017 was possible to show label next to corresponding field, like those highlighted in the following image:
Is possible to do the same in DevOps 2019. I'm succeed only to show label above corresponding field:
I'd like to show label next to corresponding field (see following image obtained with paint) because it reduces the amount of vertical space used and so more information can be shown without the user having to use the vertical scroll bar:
If is possible, could you please answer me with a example of snippet of xml code that realize it using web layout ?
It is not supported. There is a user voice that you could vote and track it.
Support to custom layout, such as show a label next to the corresponding field with the workitem web layout

Linking Bitbucket to Youtrack

I'm trying to link issues in commit messages from Bitbucket to Youtrack, but can't find proper solution.
I have for ex. commit message "CORE-214 adding foreign currency" and want to make CORE-214 link to our Youtrack as described here - https://blog.bitbucket.org/2012/06/18/use-custom-regex-to-link-anywhere-on-bitbucket/
So I create new custom link in Repository / Settings / Links using Add a custom link:
Replacement URL: https://ouryoutrack.myjetbrains.com/youtrack/issue/\1
Raw regex: CORE-\d+
However no links are showing in commit messages. We were using JIRA links integration before and everything was working fine, but that was configured using Add a repository link to JIRA feature.
The \1 part of the replacement regex is meant to insert a captured group from the regular expression. Your regex doesn't include any capture groups.
Try this instead: (CORE-\d+).

Using Asana API to Copy a Project

Is there a way to copy an Asana project using the API, similar to the "Use as a Template (Copy Project)" functionality available in the web interface?
We use 'template' projects heavily and now we are looking to automate this process.
Thanks in advance.
Till now Asana API does not facilitate this. But still if you want to make it work, fetch your template project using Asana API and fetch the tasks too. After that create new project and paste your tasks or any other details that you want. That will make things work for you.

How do I add variables to a velcoity template JIRA page?

I am looking to capture values from the 'affected version' field of New Bug screen along with the project name and dynamically add these values to the table in my new screen, which was created using a velocity template. I have recently checkout an uploaded the plugin WebWork tutorial plugin but I am having difficulty working out how to utilise this as I very new to JIRA.
As always grateful for any help.
The base class for all custom fields in JIRA is
http://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/customfields/CustomFieldType.html
and it has a method getVelocityParameters that can be used to add variables to the context used in velocity templates, e.g. $mynewvariable. I'd suggest poking around the source looking at some of the CFType.java files for examples of how this can work.
~Matt

Resources