TFS API:如何检查工作项是否已删除或在TFS服务器上不存在? (如果可以访问则不能) [英] TFS API: How to check if a work item has been deleted or is non existent on the TFS Server? (not if it is accessible)

查看:135
本文介绍了TFS API:如何检查工作项是否已删除或在TFS服务器上不存在? (如果可以访问则不能)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TFS API,我需要检查工作项是否已删除或不存在.

I am using TFS API and I need to check if a workitem has been deleted or if it does not exist.

如果我使用WorkItemStore.GetWorkItem(Int32)并在此处传递已删除工作项的ID,则该消息将显示"The work item does not existyou do not have permission to access it".

If i use WorkItemStore.GetWorkItem(Int32) and pass the Id of a deleted Work Item here, then the message says that "The work item does not exist, or you do not have permission to access it."

我只需要检查删除的条件,而不是不可访问的条件.
我已经在API中进行搜索,但是找不到任何方法来对其进行检查.

I need to check only for the deleted condition and not the inaccessible condition.
I've searched in the API but could not find any way to check for it.

我需要这个,因为我需要已删除的工作项列表.
在我的程序中,我列出了一些现有的工作项.然后,我需要检查是否删除了这些工作项中的任何一个,但不必担心登录用户是否有权查看它.

I need this because I need the list of workitems that have been deleted.
In my program I have a list of some existing workitems. I then need to check if any of these workitems are deleted but I don't have to care whether the logged in user has permissions to see it or not.

在我的程序中,我必须绝对确保已删除工作项,因为我必须为列表中的每个已删除工作项进行一些不可恢复的更改.

And in my program I need to be absolutely sure that the workitem has been deleted because I have to make some irrevertable changes for every deleted workitem from my list.

推荐答案

您不能.如果您无权打开工作项,则无法查询有关该工作项的信息.有点鸡/蛋.即使有权限,也无法确定工作项已删除或尚未创建.

You can't. If you don't have permission to open the work item, then you can't query information about it. It's a bit of chicken/egg. Even when you do have permission, you cannot be sure a workitem was deleted, or has not yet been created.

我会将您的工具作为服务运行在具有项目收集级别权限或服务器级别权限以读取工作项的用户下.您也可以实现自己的Web服务,然后执行此操作,然后在工具中使用结果.

I'd run your tool as a service somewhere under a user that has project collection level permission or server level permissions to read the work items. You could also implement your own webservice which does that and then use the outcome in your tool.

这篇关于TFS API:如何检查工作项是否已删除或在TFS服务器上不存在? (如果可以访问则不能)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆