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

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)?

Related

How to auto populate values for a drop down field in Azure Devops?

We have two fields Fix Versions and Affects Version in a bug wherein the drop down values are to be auto populated based on the tags created in Azure Repos. For ex: if there are tags v1.001.560, v1.001.561 etc and for any new tags created, the tag version should appear as a drop down value for these fields. Is there a feasible approach to achieve this? Please suggest.
In short, there is no method to meet your needs now. As a suggestion, you could submit a suggestion ticket to suggest the feature on: https://developercommunity.visualstudio.com/report?space=21&entry=suggestion. That will allow you to directly interact with the appropriate product group, and makes it more convenient for the product group to collect and categorize your suggestions.
DevOps only supports setting to specific values for your custom picklist fields. Please note custom field is used to support tracking data requirements you have that aren't met with the existing set of fields.
Besides, to realize your idea, we should auto populate tag values to the field when opening the work item. However, we also not have such a trigger even though getting the tags with Rest API.

How to configure the GitHub default issue filter parameters?

When searching for GitHub issues a default search filter (is:pr is:open) is applied. See this and this documentation pages of GitHub.
How can I configure an alternative default filter for this search?
The reason behind this is, that we want to hide our renovate bot PRs for normal operations.
I have not found any way to change the default filter. However, if someone is looking for a way to filter out those PR that do not include involving renovatebot, simply add NOT renovate-bot to your search query.

Bug with and without linked test cases

I want to pin a chart to the Azure DevOps Services dashboard that shows how many bugs in the current sprint have a linked test case or not.
I have been able to put up a query for the same but it appears that such queries can't be charted out. Is there an alternate way?
Here's the error that I get while creating a chart out of my query
Additionally, I would also like to know if there is a way to ensure that when I Resolve/Close a bug workitem in AzDo services, I can check if there is at least one associated test case work item with the bug. I have explored Bug rules but can't find out a clean way to get the link types associated with the work item. How can I achieve this?
Thanks
I have been able to put up a query for the same but it appears that
such queries can't be charted out. Is there an alternate way?
As for the error you got, it's one open issue here in our feedback forum, the product team is considering about it. But there might be some time before the feature comes true. You can track the issue to get notifications if there's any update. Sorry for the inconvenience.
Is there an alternate way?
If you just need a widget to display the results of the query, you can consider using Query Results widget, if supports tree or direct links. But if you do want the pie chart for WITs, I afraid it's not supported for now when using tree or direct links. You can check the related extensions here.
I have explored Bug rules but can't find out a clean way to get the
link types associated with the work item. How can I achieve this?
As I know we don't have such option in Azure Devops Boards.
If we close/delete one workItem, it won't display a prompt or what that tells us the related workItems are still active.
But I think that would be a great idea, so I suggest you can post one feature request here to share your idea to product team. Then we can share the feature request link here and people who interested in that would vote for you! Hope all above make some help :)

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.

How can I use labels to filter issues on the github issue tracker?

I'm using the github issue tracker for the first time, and I'm trying to manage a set of about 50 open issues. I would like to filter the set using standard Boolean queries over labels. But all I can figure out how to do is AND queries.
For example, I can show all issues that are labelled both view/controller and easy meat. But I do not know how to do any of the following queries:
Show me all open issues that are labeled view/controller but are not labeled easy meat.
Show me all open issues that are labeled either major refactoring or needs thought.
Show me every open issue that does not have any label.
I've searched and I've RTFM, and I can't find a way to ask these kinds of queries. Are such queries even possible? If so, how does one ask them?
This is possible since GitHub introduced the advanced filters.
Show me all open issues that are labeled view/controller but are not labeled easy meat.
is:open is:issue label:"view/controller" -label:"easy meat"
Notice the - before label: which says do not give me the issues containing this label.
Show me all open issues that are labeled either major refactoring or needs thought.
This is not supported (using label:A label:B means A and B instead of A or B) but you can do two different queries:
is:open is:issue label:"major refactoring"
is:open is:issue label:"needs thought"
Show me every open issue that does not have any label.
Use the no:label query:
is:open is:issue no:label
As additional info, you can refer to the GitHub documentation. And, https://github.com/issues can be your playgroud–being authenticated, you can search all the issues from repositories you have read access!
Not possible, at least using the GitHub Web app only. There may be 3rd party issue-management Web apps that do this (via GitHub API), but I'm not aware of any that do exactly and only what you want. Check out:
http://gissues.com/
http://huboard.com/
http://githubissues.herokuapp.com/
https://zapier.com/zapbook/github/trello/ (trello integration)
There are ways to achieve nearly what you want using formatted issue naming + searching, as described here:
https://softwareengineering.stackexchange.com/questions/129714/how-to-manage-github-issues-for-priority-etc