How to upload a new version of a task group via api? - azure-devops-rest-api

I am trying to write some software to programmatically manage a set of TaskGroups across multiple projects. My issue is that if I have a TaskGroup with multiple published versions, I can't seem to get that update into a different project.
If I try to to just POST the updated version of the TaskGroup, I get a
Microsoft.TeamFoundation.DistributedTask.WebApi.MetaTaskDefinitionExistsException
because it detects that it has the same name as another TaskGroup.
If, however, I try to PUT the update into the existing TaskGroup, it for some reason acts like it can't find the TaskGroup with that ID (even though I have verified that it exists in that project).
Does anyone have any experience with this?

If you want to update a task group in a project, you should follow this api to update it:
PUT https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?api-version=5.0-preview.1
If you want to use the task group in other projects, you can try to list the task group and then create a task group in new project:
List task group:
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?api-version=5.0-preview.1
Add a task group:
POST https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups?api-version=5.0-preview.1

Related

How to prevent duplication of JIRA Tickets in python

I have 2 instances of JIRA . I have written a script where tickets from one instance are read and a replicas of same are created in another instance.
Now the problem is , whenever I run the script it is generating duplicate tickets again and again.
How do I prevent this duplication of tickets? Please help.
Ideas:
Create a link field in each Jira issue and populate it. If the field is populated the script should not create a new issue
Use a "last synced" field in the source Jira and only create a new issue if the source issue has not been synced
You don't say but I assumed that this is a one way sync

Cannot create VSTS Security Group using API

I am attempting to create new project-level security groups using the vsts api.
Creating a new group at the collection level works as documented.
However, creating a new group at the project level isn't working. When I call the API as documented, I end up with another a group at the collection level.
How should the create work at the project level? Is there someplace I should be looking for more examples and clarification?
Thanks!!
Please try below REST API to create a project level security group:
POST https://{accountName}.visualstudio.com/{ProjectName}/_api/_identity/ManageGroup
Content-Type : application/json
{"name":"GroupNamehere","description":"Create a Test Group 0505 ","tfid":""}

Renaming groups in Jira

How to rename groups in Jira? I am finding difficult to rename groups in jira. I already tried renaming groups in Jira. But it is not updating in created by and assigned dropdowns.
You have to rename groups via SQL since there is no option from the web admin interface to do so. See this solution provided by the Atlassian community:
https://community.atlassian.com/t5/Questions/Need-to-rename-group/qaq-p/378695
WARNING: make a backup of your database before any direct sql statement is executed! Changing the database directly is at your own risk. Also, renaming the group DOES NOT transfer membership, so the renamed group will be empty. If your group already has members, the simplest solution would be to:
delete the group
create a new one
reassign users to the new group
Hope this helps!

How do I create custom stanzas in MongooseIM?

I need a way to create customized stanzas and have mongooseIM recognize them and store the data accordingly inside of a given database such as mysql for later retrieval.
The reason I want to do this is because an app that I am building has a chat that requires complex querying based on sub objects'parameters. Also anything a user does inside of the app but outside of the chat like change the title of the group chat or like a post, it is logged inside of the chat as a log message with the given postId and userId.
So ideally I want it to do something like this:
<postId>1</postId> //So that I can query by post id
<description>Hello</description> //Data for clients to update real time
<userId>1</userId> //also want to be able to query the db by this.
all these variables should be saved into the database that is provided for MAM inside of the MongooseIM
You need to rite your custom mod in erlang. Here is how you can start on this :
https://mongooseim.readthedocs.io/en/latest/user-guide/Getting-started/
Build and install from source code
To build and install MongooseIM from source code, do the following:
Clone the Git repository:
 git clone https://github.com/esl/MongooseIM.git
Go to your MongooseIM directory.
Run the following command: make rel.
In the code You will see apps/ejabberd/src
Write you mode these and compile to get bin file and move the bin files to the release.

Creating a template for work items in TFS

Does TFS 2013 have the ability to automatically add Templated tasks to a work item?
So I create a work item, it automatically adds some tasks for it such as Code, Test, CodeReview, HelpGuide
Can you guide me to the right place to read about it if it has this ability.
Built-in? Then no.
There is an open source TFS Serverside plugin, called TFS Aggregator which will allow you to run a piece of code every time a workitem changes. Creating subtasks when a parent task changes state or is created is a piece of cake.
See:
https://github.com/tfsaggregator/tfsaggregator/releases
https://github.com/tfsaggregator/tfsaggregator/wiki/Auto-Create-Children
If you don't want to run a server side handler, then you may be able to use a script (powershell can do pretty powerful things when using the Client Object Model).
Or you can use the copy-paste magic of the Excel plugin for TFS. Simply put the tasks you want to create on the clipboard (without an ID) then use the "Insert Rows" paste option to paste them directly under their prospective parent (in a tree based query). Upon publishing the tasks will be associated to the parent. Play with the Title 1, Title 2, Title 3 etc fields to control the nesting.

Resources