@@ -12,15 +12,13 @@ async function getIterationPathByOptions(connection: WebApi, project: string, it
1212 return undefined ;
1313 }
1414
15+ const originalIteration = iteration ;
1516 iteration = iteration . toLowerCase ( ) ;
1617
1718 if ( iteration === 'all' ) {
1819 return undefined ;
1920 }
2021
21- if ( iteration !== 'current' && iteration !== 'next' ) {
22- return iteration ;
23- }
2422
2523
2624 const myTeams = await getTeams ( connection , project , { mine : true } ) ;
@@ -31,6 +29,15 @@ async function getIterationPathByOptions(connection: WebApi, project: string, it
3129 }
3230
3331 const team = myTeams [ 0 ] . name ! ;
32+ const allIterations = await getTeamIterations ( connection , project , team , { } ) ;
33+
34+ if ( iteration !== 'current' && iteration !== 'next' ) {
35+
36+ const matched = allIterations . find ( i => i . name ?. toLowerCase ( ) === iteration || i . path ?. toLowerCase ( ) === iteration ) ;
37+ return matched ?. path ?? originalIteration ;
38+ }
39+
40+
3441 const iterations = await getTeamIterations ( connection , project , team , { current : true } ) ;
3542
3643 if ( iterations . length === 0 ) {
@@ -44,7 +51,6 @@ async function getIterationPathByOptions(connection: WebApi, project: string, it
4451 }
4552
4653 if ( iteration === 'next' ) {
47- const allIterations = await getTeamIterations ( connection , project , team , { } ) ;
4854 const currentIndex = allIterations . findIndex ( i => i . id === currentIteration . id ) ;
4955
5056 if ( currentIndex === - 1 || currentIndex === allIterations . length - 1 ) {
0 commit comments