How do I apply an annotation to all Grafana dashboards? - grafana

I want to add a new annotation query to every dashboard. Is there a way to do this without just manually doing it 1 by 1 for each individual dashboard?
The example we want to add is to include the GitHub Releases for our GitHub repo to each graph so we can see the effect of releases on metrics. We're using the GitHub plugin for this.
Is there a way to do this en-masse?

The team at Grafana said there currently is not a way to do this automatically or via the UI.
Their recommendation would be to write a script which uses the Grafana API to add the annotations:
https://grafana.com/docs/grafana/latest/developers/http_api/annotations/
I've not attempted this, but it might be beneficial to others.
We did it manually instead.

Related

How to access and edit Deployment information for user stories in azure devops?

Picture below.
Is there an API endpoint to edit/add new information here? We are currently rewriting our releases to yaml releases, and seems like we will lose this automatic feature, and would like to preserve it with custom bash scripts that fill this information.

Programmatically Set Column Options in TFS 2018.2

We are creating team projects with the rest API and would like to automate the configuration the column options like in the UI. We want to configure the column and column order for all backlogs.
I can get the backlogConfiguration in TFS and VSTS using the existing APIs but it does not look like there is a POST, PATCH or PUT method to update the backlogConfiguration. Is there any other way to programmatically set these values?
We are running TFS 2018 Update 2.
No, there isn't the API to update/change the Column Options. We cannot achieve that programmatically.

VSTS Chart Query by Parent/Feature

I'm looking to create a nice dashboard in VSTS with a set of relevant charts for my collegues so they can keep track of things.
We have a project for keeping track of it operations tasks. In this project we've created different Features for different departments of the company.
Is there a way to filter the user stories by parent/feature so that I can make different charts for different departments? I've managed to create a "Work items and direct links" query that actually only outputs the User stories in one feature, but such queries can not be used in charts unfortunately.
Other workarounds would be acceptable too.
There is a Work Item Visualization extension that you can check whether it meets your requirement (Can highlight specified work items).
Another way is that you can custom a dashboard widget or other extension to display the result: Add a dashboard widget.
There are many extension samples that may benefit you: vsts-extension-samples

Is it possible to know when a label was set/unset to an issue using Github API?

I'd like to add a new column in a Github issues report with the date when a specific label was added for the first time. Checking at the Issue Labels API on Github, I see no way of achieving this, as Label entities don't contain dates.
Is there another way to find out when a label was set to an issue?
No, there isn't currently a way to do this. The nearest thing would be the updated_at entry on an issue, but there's no way to guarantee that that update was the result of a label being set on the issue.
GitHub clearly has this information, as the timestamp from a label being applied is available in the web UI—I wonder if you might be better off scraping the page (and asking GitHub to provide this information via the API)?

How to add custom attributes in GitHub issues?

We are trying to use GitHub for issue tracking in one of our projects and while its very simply to use, we aren't sure its powerful enough at the same time to fulfil our needs to organize our issue management since we can't find a way to customize it.
Question: Is it possible to add custom attributes in GitHub for issue tracking, search/sort and export the list of issues with those attributes? For example, we'd like to add and use following attributes:
External Issue ID: There is an external list of issues/change requests maintained by a separate group that we need to associate
our issues with and need a field to specify the external issue ID.
Priority: so that we can easily discuss and prioritize what we want to tackle first
Severity: to identify impact on the system
Type of Issue: Bug, Change Request, New Requirement
Class: Performance, Security, Function, Compliance etc.
Source: to track whether issue was reported by a specific customer (which could be in hundreds), end user, internal team,
partner etc.
Date Opened: I think this is maintained internally by GitHub but not exposed anywhere in the UI
Date Closed
etc.
We understand some of these can be implemented with labels but there would be too many of them to assign and they do not allow exclusivity (for example you can only specify one priority - high, medium, or low assigning - to an issue)
Any ideas if and how this can be implemented in GitHub?
If not, any recommendations?
Thanks!
As you mentioned already, this so far is only done by using labels, for example the way i do priority is having multiple labels:
Priority: Blocker
Priority: High
....
Yes, unfortunately this feature is not intended to exclusively select one value per category as these are labels.
There is a github issue that proposes a new feature to GitHub so that we can have a Priority attribute in every GitHub issue right here
https://github.com/isaacs/github/issues/472
Not sure about all the other custom attributes, but maybe this would be a good start for your idea.
There does not seem to be a way to create custom parameters. You may be able to do this by storing the data inline in the text of the issue and then parsing that issue text programatically, but that's kind of a hack.
For instance, if you wanted to link a GitHub issue to an internal bug tracker like JIRA, just use the JIRA issue name in the text of the GitHub issue and then write a regular expression to parse it back out. This requires a little bit of extra plumbing on top of GitHub.
Date opened and closed are available in the API. See documentation.
(Incidentally, I'd note that the lack of customisation and complexity is a key feature of GitHub's issue tracking system: it is designed for developers, not project managers who want to tweak it into a confusing JIRA-like hellscape of misery.)
Update June 2021: you could use custom fields for those attributes!
New beta features within GitHub Issues, with better ways to plan, track, and manage projects.
Read more on the GitHub Issues page or in the FAQ.
✨ NEW – Project planning for developers
Available in limited public beta
Built like a spreadsheet, project tables give you a live canvas to filter, sort, and group issues and pull requests.
Tailor them to your needs with custom fields and saved views.
Sign up for the beta now.
That includes:
Extend issues with custom fields with support for text, number, date and single-select types
Change custom field values right from the issues sidebar
Filter, sort, and group by any field
Use tags
Most of the time you can put the kinds of things you want in the body of the issue as text or use a tag for things like priority. You only need to set priority if it's not the default one.