@@ -130,13 +130,36 @@ ... on User {
130
130
query FindUpdatedIssues($organization: String!, $repository: String!, $questlabels: [String!], $cursor: String) {
131
131
repository(owner: $organization, name: $repository) {
132
132
issues(
133
- """ + EnumerationQueryBody ;
133
+ """ + EnumerationQueryBody +
134
+ """
135
+ timelineItems(last: 5) {
136
+ nodes {
137
+ ... on ClosedEvent {
138
+ closer {
139
+ ... on PullRequest {
140
+ url
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ """ ;
134
151
135
152
protected const string EnumerateQuestPullRequestQueryText = """
136
153
query FindUpdatedPullRequests($organization: String!, $repository: String!, $questlabels: [String!], $cursor: String) {
137
154
repository(owner: $organization, name: $repository) {
138
155
pullRequests(
139
- """ + EnumerationQueryBody ;
156
+ """ + EnumerationQueryBody +
157
+ """
158
+ }
159
+ }
160
+ }
161
+ }
162
+ """ ;
140
163
141
164
private const string EnumerationQueryBody = """
142
165
first: 25
@@ -163,17 +186,6 @@ ... on User {
163
186
name
164
187
}
165
188
}
166
- timelineItems(last: 5) {
167
- nodes {
168
- ... on ClosedEvent {
169
- closer {
170
- ... on PullRequest {
171
- url
172
- }
173
- }
174
- }
175
- }
176
- }
177
189
projectItems(first: 25) {
178
190
... on ProjectV2ItemConnection {
179
191
nodes {
@@ -226,13 +238,9 @@ ... on User {
226
238
bodyHTML
227
239
}
228
240
}
229
- }
230
- }
231
- }
232
- }
233
241
""" ;
234
242
235
- private protected QuestIssueOrPullRequest ( JsonElement issueNode , string organization , string repository ) : base ( issueNode )
243
+ private protected QuestIssueOrPullRequest ( JsonElement issueNode , string organization , string repository , bool includeTimeLine = true ) : base ( issueNode )
236
244
{
237
245
var author = Actor . FromJsonElement ( ResponseExtractors . GetAuthorChildElement ( issueNode ) ) ;
238
246
FormattedAuthorLoginName = ( author is not null ) ?
@@ -260,10 +268,13 @@ private protected QuestIssueOrPullRequest(JsonElement issueNode, string organiza
260
268
ProjectStoryPoints = [ ..points . Where ( p => p is not null ) . ToArray ( ) ] ;
261
269
262
270
// check state. If re-opened, don't reference the (not correct) closing PR
263
- ClosingPRUrl = ResponseExtractors . GetChildArrayElements ( issueNode , "timelineItems" , item =>
264
- ( item . TryGetProperty ( "closer" , out JsonElement closer ) && closer . ValueKind == JsonValueKind . Object ) ?
265
- ResponseExtractors . OptionalStringProperty ( closer , "url" )
266
- : default ) . LastOrDefault ( url => url is not null ) ;
271
+ if ( includeTimeLine )
272
+ {
273
+ ClosingPRUrl = ResponseExtractors . GetChildArrayElements ( issueNode , "timelineItems" , item =>
274
+ ( item . TryGetProperty ( "closer" , out JsonElement closer ) && closer . ValueKind == JsonValueKind . Object ) ?
275
+ ResponseExtractors . OptionalStringProperty ( closer , "url" )
276
+ : default ) . LastOrDefault ( url => url is not null ) ;
277
+ }
267
278
268
279
LinkText = $ """
269
280
<a href = "https://github.com/{ organization } /{ repository } /issues/{ Number } ">
0 commit comments