0

I'm using the Microsoft.VisualStudio.Services.Client library (added via NuGet) to connect to my on-prem Azure Dev Ops server and query various bits of information regarding pull requests. I'd like to make a little notification application that can alert me if someone has replied to a comment I made on a pull request. The trick is that I only want to see the notification if I haven't already looked at it.

I know that the system knows when I last looked at the pull request because it decorates pull requests with new content (comments, new code, etc.) with a little dot and when I open a pull request, it tells me that there are new comments since I visited last and tells me how long ago I looked at it.

How do I get access to the date that I opened the pull request in the web via the client libraries or REST? In other words, how would my app know that I have or haven't looked at new comments via the web page?

spdygnlz
  • 21
  • 4
  • Hi @spdynglz did you check out below answer? please let me if there is any question. – Levi Lu-MSFT Feb 02 '20 at 15:36
  • @LeviLu-MSFT - Hi. I do know about the notifications that I can configure for comments on pull requests. My goal, however, was to create an "always on top" type of indication app that lets you know if you have something to go look at. Unfortunately, saving off the status isn't going to give me what I need as it has to be able to update if you go read comments on the web page. I figured the functionality should be available because it's in the web interface. – spdygnlz Feb 11 '20 at 16:04

1 Answers1

0

I did not find such an api that can retrieve the timestamp the last time you looked at the PR.

There is lastUpdatedDate you can use to track the comments that were checked. So as a workaround you can save the lastUpdatedDate to a file in your code, and compare this value everytime when you call api. Then you will get the latest updated comments.

However, PR comments notification can also be configured from azure devops. You can go to your user profile on the top right corner and select notifications to enable the notification for A comment is left on a pull request.

enter image description here

For more information about Azure devops notification, you can check this document.

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
  • Just to clarify, does the "lastUpdatedDate" record when you just view a pull request but don't make any changes to it? I suppose I could try it out, but that could help now that I think about it... – spdygnlz Feb 11 '20 at 16:29