共用方式為


Pull Request Threads - Get

擷取提取要求中的線程。

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}?api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/threads/{threadId}?$iteration={$iteration}&$baseIteration={$baseIteration}&api-version=7.1

URI 參數

名稱 位於 必要 類型 Description
organization
path True

string

Azure DevOps 組織的名稱。

pullRequestId
path True

integer (int32)

提取要求的標識碼。

repositoryId
path True

string

提取要求目標分支的存放庫標識碼。

threadId
path True

integer (int32)

線程的標識碼。

project
path

string

項目識別碼或項目名稱

api-version
query True

string

要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。

$baseIteration
query

integer (int32)

如果指定,則會使用這個反覆專案作為差異的左側來追蹤線程位置。

$iteration
query

integer (int32)

如果指定,則會使用此反覆專案作為差異右側的追蹤線程位置。

回應

名稱 類型 Description
200 OK

GitPullRequestCommentThread

成功作業

安全性

oauth2

類型: oauth2
Flow: accessCode
授權 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

範圍

名稱 Description
vso.code 授與讀取有關認可、變更集、分支和其他版本控制成品之原始程式碼和元數據的能力。 也授與搜尋程式代碼的能力,並透過服務攔截取得版本控制事件的通知。
vso.threads_full 授與讀取和寫入提取要求批注線程的能力。

定義

名稱 Description
Comment

表示批注,這是批注線程中可能有許多的批注之一。

CommentIterationContext

批註反覆項目內容可用來識別建立線程時所檢視的差異。

CommentPosition
CommentThreadContext
CommentThreadStatus

批注線程的狀態。

CommentTrackingCriteria

批注追蹤準則可用來識別線程已追蹤到哪些反覆項目內容(如果有的話),以及有關原始位置和檔名的一些詳細數據。

CommentType

建立時的批注類型。

GitPullRequestCommentThread

表示提取要求的批注線程。 線程包含其保留檔案的元數據,以及一或多個批注(初始批注和後續回復)。

GitPullRequestCommentThreadContext

批注線程內容包含線程建立時檢視差異的詳細數據,以及線程是否已從該原始差異追蹤。

IdentityRef
PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 接受 DBNull 以外的所有基本類型值(任何具有 TypeCode != TypeCode.Object的類型)。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型會重新調整為 String。 Byte[] 預期為base64編碼字串。

ReferenceLinks

表示 REST 參考連結集合的類別。

Comment

表示批注,這是批注線程中可能有許多的批注之一。

名稱 類型 Description
_links

ReferenceLinks

其他相關對象的連結。

author

IdentityRef

批註的作者。

commentType

CommentType

建立時的批注類型。

content

string

批註內容。

id

integer (int16)

批註標識碼。 標識元從 1 開始,對提取要求而言是唯一的。

isDeleted

boolean

此批註是否已虛刪除。

lastContentUpdatedDate

string (date-time)

上次更新批注內容的日期。

lastUpdatedDate

string (date-time)

上次更新批注的日期。

parentCommentId

integer (int16)

父批注的標識碼。 這會用於回復。

publishedDate

string (date-time)

批注第一次發行的日期。

usersLiked

IdentityRef[]

喜歡此批注的用戶清單。

CommentIterationContext

批註反覆項目內容可用來識別建立線程時所檢視的差異。

名稱 類型 Description
firstComparingIteration

integer (int16)

建立線程時,差異左邊檔案的反覆專案。 如果此值等於 SecondComparingIteration,則此版本是提取要求來源和目標分支之間的一般認可。

secondComparingIteration

integer (int16)

建立線程時,差異右側檔案的反覆專案。

CommentPosition

名稱 類型 Description
line

integer (int32)

線程位置的行號。 從 1 開始。

offset

integer (int32)

線程在行內位置的字元位移。 從 0 開始。

CommentThreadContext

名稱 類型 Description
filePath

string

相對於存放庫根目錄的檔案路徑。 用戶端可以使用任何路徑格式。

leftFileEnd

CommentPosition

線程範圍在左檔案中最後一個字元的位置。

leftFileStart

CommentPosition

線程範圍在左檔案中第一個字元的位置。

rightFileEnd

CommentPosition

線程範圍在右檔案中最後一個字元的位置。

rightFileStart

CommentPosition

線程範圍在右檔案中第一個字元的位置。

CommentThreadStatus

批注線程的狀態。

Description
active

線程狀態為作用中。

byDesign

線程狀態會依設計方式解析。

closed

線程狀態已關閉。

fixed

線程狀態會解析為固定狀態。

pending

線程狀態為擱置中。

unknown

線程狀態未知。

wontFix

線程狀態會解析為 無法修正。

CommentTrackingCriteria

批注追蹤準則可用來識別線程已追蹤到哪些反覆項目內容(如果有的話),以及有關原始位置和檔名的一些詳細數據。

名稱 類型 Description
firstComparingIteration

integer (int32)

diff 左側檔案的反覆項目,線程將追蹤到該檔案。 如果此值大於 0,則會追蹤線程。

origFilePath

string

在追蹤之前,已建立線程的原始檔案路徑。 如果有問題的檔案在稍後的反覆專案中重新命名,這將會與目前的線程檔案路徑不同。

origLeftFileEnd

CommentPosition

線程範圍在左檔案中最後一個字元的原始位置。

origLeftFileStart

CommentPosition

線程範圍在左檔案中第一個字元的原始位置。

origRightFileEnd

CommentPosition

線程範圍中右檔案中最後一個字元的原始位置。

origRightFileStart

CommentPosition

線程範圍在右檔案中第一個字元的原始位置。

secondComparingIteration

integer (int32)

diff 右側檔案的反覆項目,線程將會追蹤到該檔案。 如果此值大於 0,則會追蹤線程。

CommentType

建立時的批注類型。

Description
codeChange

批註因程式代碼變更而產生。

system

批注代表系統訊息。

text

這是一般使用者批注。

unknown

批注類型未知。

GitPullRequestCommentThread

表示提取要求的批注線程。 線程包含其保留檔案的元數據,以及一或多個批注(初始批注和後續回復)。

名稱 類型 Description
_links

ReferenceLinks

其他相關對象的連結。

comments

Comment[]

批注清單。

id

integer (int32)

批注線程標識碼。

identities

<string,  IdentityRef>

與此線程相關的身分識別集

isDeleted

boolean

指定當刪除所有批注時,是否刪除線程。

lastUpdatedDate

string (date-time)

上次更新此線程的時間。

properties

PropertiesCollection

與線程相關聯的選擇性屬性,做為索引鍵/值組的集合。

publishedDate

string (date-time)

此線程發佈的時間。

pullRequestThreadContext

GitPullRequestCommentThreadContext

提取要求唯一的擴充內容資訊

status

CommentThreadStatus

批注線程的狀態。

threadContext

CommentThreadContext

指定線程內容,例如左/右檔案中的位置。

GitPullRequestCommentThreadContext

批注線程內容包含線程建立時檢視差異的詳細數據,以及線程是否已從該原始差異追蹤。

名稱 類型 Description
changeTrackingId

integer (int32)

用來追蹤反覆專案的批注。 查看反覆項目的變更清單,即可找到此值。 必須針對具有反覆項目支援的提取要求設定。 否則,不需要「舊版」提取要求。

iterationContext

CommentIterationContext

建立線程時所檢視的反覆項目內容。

trackingCriteria

CommentTrackingCriteria

用來追蹤此線程的準則。 如果在傳回線程時填入這個屬性,則線程會使用指定的準則從其原始位置追蹤。

IdentityRef

名稱 類型 Description
_links

ReferenceLinks

此欄位包含圖表主旨的相關零或更多有趣連結。 您可以叫用這些連結,以取得此圖表主題的其他關聯性或更詳細的資訊。

descriptor

string

描述元是在系統執行時參考圖表主旨的主要方式。 此欄位會唯一識別帳戶和組織之間的相同圖表主題。

directoryAlias

string

已淘汰 - 查詢 IdentityRef “_links” 字典中參考的 Graph 使用者,即可擷取

displayName

string

這是圖形主體的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。

id

string

imageUrl

string

已淘汰 - 可在 IdentityRef “_links” 字典的 “avatar” 專案中取得

inactive

boolean

已淘汰 - 可藉由查詢 GraphUser “_links” 字典的 “membershipState” 專案中參考的 Graph 成員資格狀態來擷取

isAadIdentity

boolean

已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

已淘汰 - 未在 ToIdentityRef 的大部分預先存在實作中使用

uniqueName

string

已淘汰 - 請改用 Domain+PrincipalName

url

string

此 URL 是此圖表主體來源資源的完整路由。

PropertiesCollection

類別會將屬性包表示為索引鍵/值組的集合。 接受 DBNull 以外的所有基本類型值(任何具有 TypeCode != TypeCode.Object的類型)。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型會重新調整為 String。 Byte[] 預期為base64編碼字串。

名稱 類型 Description
count

integer (int32)

集合中的屬性計數。

item

object

keys

string[]

集合中的索引鍵集合。

values

string[]

集合中的值集合。

表示 REST 參考連結集合的類別。

名稱 類型 Description
links

object

連結的只讀檢視。 因為參考連結是只讀的,所以我們只想要將其公開為只讀。