@@ -24,6 +24,16 @@ public record StoryPointSize
24
24
[ "Dec" ] = 12 // 2
25
25
} ;
26
26
27
+ private static int ? PriorityValue ( string ? projectPriority )
28
+ {
29
+ // Start by 1, because our DevOps instance uses 1 - 4
30
+ if ( projectPriority ? . Contains ( "0" ) == true ) return 1 ;
31
+ if ( projectPriority ? . Contains ( "1" ) == true ) return 2 ;
32
+ if ( projectPriority ? . Contains ( "2" ) == true ) return 3 ;
33
+ if ( projectPriority ? . Contains ( "3" ) == true ) return 4 ;
34
+ return default ;
35
+ }
36
+
27
37
public static int MonthOrdinal ( string month ) => s_months [ month ] ;
28
38
29
39
public static bool TryGetMonthOrdinal ( string month , out int ordinal )
@@ -42,13 +52,15 @@ public static bool TryGetMonthOrdinal(string month, out int ordinal)
42
52
// size may or may not have been set yet:
43
53
string size = "🐂 Medium" ;
44
54
string ? sprintMonth = default ;
55
+ int ? priority = default ;
45
56
foreach ( JsonElement field in projectItem . Descendent ( "fieldValues" , "nodes" ) . EnumerateArray ( ) )
46
57
{
47
58
if ( field . TryGetProperty ( "name" , out JsonElement fieldValue ) )
48
59
{
49
60
string ? fieldName = field . Descendent ( "field" , "name" ) . GetString ( ) ;
50
61
if ( fieldName == "Sprint" ) sprintMonth = fieldValue . GetString ( ) ;
51
62
if ( fieldName == "Size" ) size = fieldValue . GetString ( ) ?? "🐂 Medium" ;
63
+ if ( fieldName == "Priority" ) priority = PriorityValue ( fieldValue . GetString ( ) ) ?? 2 ;
52
64
}
53
65
}
54
66
if ( ( projectTitle is not null ) &&
@@ -60,7 +72,7 @@ public static bool TryGetMonthOrdinal(string month, out int ordinal)
60
72
string month = sprintMonth ?? components [ 1 ] ;
61
73
if ( int . TryParse ( components [ yearIndex ] , out int year ) )
62
74
{
63
- sz = new StoryPointSize ( year , month . Substring ( 0 , 3 ) , size ) ;
75
+ sz = new StoryPointSize ( year , month . Substring ( 0 , 3 ) , size , priority ) ;
64
76
}
65
77
}
66
78
} else
@@ -70,16 +82,18 @@ public static bool TryGetMonthOrdinal(string month, out int ordinal)
70
82
return sz ;
71
83
}
72
84
73
- private StoryPointSize ( int CalendarYear , string Month , string Size )
85
+ private StoryPointSize ( int CalendarYear , string Month , string Size , int ? Priority )
74
86
{
75
87
this . CalendarYear = CalendarYear ;
76
88
this . Month = Month ;
77
89
this . Size = Size ;
90
+ this . Priority = Priority ;
78
91
}
79
92
80
93
public int CalendarYear { get ; }
81
94
public string Month { get ; }
82
95
public string Size { get ; }
96
+ public int ? Priority { get ; }
83
97
84
98
public bool IsPastIteration
85
99
{
0 commit comments