5

We have created a few extensions for Azure DevOps (0) that are pipeline extensions.

We are trying to create new extensions that can react to changes in work items of Azure Boards. The API's for interacting with changes in work items are fairly straight-forward, but we are struggling with configuration of the extension.

Essentially we need to allow the users to configure the extension on two levels

1) On "Organization level"

It should be possible for a user (Project Administrator) to configure parameters as "external system URL" etc. An example of this could be something like below mockup:

enter image description here

2) On "Project level"

For each project in Azure DevOps an admin should be able to configure parameters like "Enable/disable extension" or "External UID" etc. An example of this could be something like below mockup:

Organization level

When the extension reacts to "Work item saved" it will query the parameters on both levels to figure out what to do.

My problem is: where the heck do I save this information? I could add a number of "custom fields" to the template in use, but since fields can only be added to work item types, it is really not ideal in any way.

Where can I save this information through the API's?

PS: Source code for our extensions are available as OSS (Apache license) here:

(0) https://bitbucket.org/projectum/

Thank you :-)

Jesper Lund Stocholm
  • 1,973
  • 2
  • 27
  • 49

2 Answers2

2

It turns out that Azure DevOps has a way to store data for extensions. It can store data on both Project Collection scope as well as User scope.

I think I will be able to use this to store the data I need. All I need now is to figure out where to put the UI that the user or admin will use to maintain this data.

https://learn.microsoft.com/en-us/azure/devops/extend/develop/data-storage?view=vsts

:-)

Jesper Lund Stocholm
  • 1,973
  • 2
  • 27
  • 49
1

For #1, it somewhat looks like what you can configure under a pipeline's service connections. This is per project though and not at an organization level.

enter image description here

This might be easier to manage outside of an extension and instead just use a service hook to call some middle tier that accomplishes what you want.

Matt
  • 3,658
  • 3
  • 14
  • 27
  • Hi @Matt, regarding 1), can the values be read from an extension afterwards? and 2) well ... the whole point is to avoid a middle-tier for the extension. Having an extension in the Market Place makes it hard to demand a middle-tier component that we should host ourselves or have the customer/user/organization spin up before the extension can be used. – Jesper Lund Stocholm Jan 10 '19 at 16:41
  • I stumbled over this https://stackoverflow.com/questions/52335657/vsts-create-service-connection-via-api so service connections can indeed be accessed ... but alas, not the password specified. – Jesper Lund Stocholm Jan 10 '19 at 16:59