1
1
///usr/bin/env jbang "$0" "$@" ; exit $?
2
2
3
3
//DEPS info.picocli:picocli:4.6.3
4
- //DEPS https://github.com/unblu/gitlab-workitem-graphql-client/commit/f36726404b311bab0d5df41eff8072950fb9f97c
4
+ //DEPS https://github.com/unblu/gitlab-workitem-graphql-client/commit/e70fa10b68363bf6f84050fd3f2a71d1f63c04cc
5
5
//DEPS io.smallrye:smallrye-graphql-client-implementation-vertx:2.11.0
6
6
//DEPS org.jboss.logmanager:jboss-logmanager:3.1.1.Final
7
7
//JAVA 17
44
44
import graphql .gitlab .model .EpicBoardUpdateInput ;
45
45
import graphql .gitlab .model .EpicBoardUpdatePayload ;
46
46
import graphql .gitlab .model .EpicList ;
47
- import graphql .gitlab .model .GroupContainingEpicBoard ;
48
- import graphql .gitlab .model .GroupContainingIssueBoard ;
47
+ import graphql .gitlab .model .GroupContainingEpicBoards ;
48
+ import graphql .gitlab .model .GroupContainingIssueBoards ;
49
+ import graphql .gitlab .model .GroupContainingSingleEpicBoard ;
50
+ import graphql .gitlab .model .GroupContainingSingleIssueBoard ;
49
51
import graphql .gitlab .model .LabelID ;
50
52
import graphql .gitlab .model .ListID ;
51
- import graphql .gitlab .model .ProjectContainingIssueBoard ;
53
+ import graphql .gitlab .model .ProjectContainingIssueBoards ;
54
+ import graphql .gitlab .model .ProjectContainingSingleIssueBoard ;
52
55
import graphql .gitlab .model .UpdateBoardInput ;
53
56
import graphql .gitlab .model .UpdateBoardListInput ;
54
57
import graphql .gitlab .model .UpdateBoardListPayload ;
@@ -110,7 +113,7 @@ public class BoardGraphQLScript implements Callable<Integer> {
110
113
String configFile ;
111
114
112
115
private static enum Action {
113
- GET_BOARDS , CREATE_BOARD , UPDATE_BOARD , DELETE_BOARD , GET_BOARD_LIST , CREATE_BOARD_LIST , UPDATE_BOARD_LIST , DELETE_BOARD_LIST
116
+ GET_BOARDS , GET_BOARD , CREATE_BOARD , UPDATE_BOARD , DELETE_BOARD , GET_BOARD_LIST , CREATE_BOARD_LIST , UPDATE_BOARD_LIST , DELETE_BOARD_LIST
114
117
}
115
118
116
119
private static enum Type {
@@ -135,6 +138,9 @@ public Integer call() throws Exception {
135
138
case GET_BOARDS :
136
139
getBoards (api );
137
140
break ;
141
+ case GET_BOARD :
142
+ getBoard (api );
143
+ break ;
138
144
case CREATE_BOARD :
139
145
createBoard (api );
140
146
break ;
@@ -166,17 +172,32 @@ public Integer call() throws Exception {
166
172
private void getBoards (WorkitemClientApi api ) {
167
173
ensureNamespace ();
168
174
if (type == Type .EPIC ) {
169
- GroupContainingEpicBoard g = api .getEpicBoardsInGroup (group );
175
+ GroupContainingEpicBoards g = api .getEpicBoardsInGroup (group );
170
176
System .out .println (g .getEpicBoards ());
171
177
} else if (project != null ) {
172
- ProjectContainingIssueBoard p = api .getIssueBoardsInProject (project );
178
+ ProjectContainingIssueBoards p = api .getIssueBoardsInProject (project );
173
179
System .out .println (p .getBoards ());
174
180
} else {
175
- GroupContainingIssueBoard g = api .getIssueBoardsInGroup (group );
181
+ GroupContainingIssueBoards g = api .getIssueBoardsInGroup (group );
176
182
System .out .println (g .getBoards ());
177
183
}
178
184
}
179
185
186
+ private void getBoard (WorkitemClientApi api ) {
187
+ ensureNamespace ();
188
+ ensureExists (boardId , "id" );
189
+ if (type == Type .EPIC ) {
190
+ GroupContainingSingleEpicBoard g = api .getEpicBoardInGroup (group , new BoardsEpicBoardID (boardId ));
191
+ System .out .println (g .getEpicBoard ());
192
+ } else if (project != null ) {
193
+ ProjectContainingSingleIssueBoard p = api .getIssueBoardInProject (project , new BoardID (boardId ));
194
+ System .out .println (p .getBoard ());
195
+ } else {
196
+ GroupContainingSingleIssueBoard g = api .getIssueBoardInGroup (group , new BoardID (boardId ));
197
+ System .out .println (g .getBoard ());
198
+ }
199
+ }
200
+
180
201
private void createBoard (WorkitemClientApi api ) {
181
202
ensureNamespace ();
182
203
ensureExists (name , "name" );
0 commit comments