filter and update issue wtih assingee
This commit is contained in:
@@ -54,6 +54,9 @@ func runGetIssuesCmd(cmd *cobra.Command, args []string) error {
|
||||
if cmd.Flags().Changed("priority") {
|
||||
filter.Priority = &listFlags.priority
|
||||
}
|
||||
if cmd.Flags().Changed("assignee") {
|
||||
filter.Assignee = &listFlags.assignee
|
||||
}
|
||||
|
||||
// Fetch issues based on the search query and filters.
|
||||
app := AppFromContext(cmd.Context())
|
||||
@@ -76,6 +79,7 @@ func init() {
|
||||
ListCmd.Flags().StringVarP(&listFlags.status, "status", "s", "", "Filter issues by status (open, closed, in_progress)")
|
||||
ListCmd.Flags().StringVarP(&listFlags.issueType, "type", "t", "", "Filter issues by type (bug, feature, task)")
|
||||
ListCmd.Flags().IntVarP(&listFlags.priority, "priority", "p", 0, "Filter issues by priority (0-4)")
|
||||
ListCmd.Flags().StringVarP(&listFlags.assignee, "assignee", "a", "", "Filter issues by assignee")
|
||||
|
||||
ListCmd.Flags().IntVarP(&listFlags.limit, "limit", "l", 25, "Limit the number of issues returned")
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ func init() {
|
||||
UpdateCmd.Flags().StringVarP(&updateFlags.description, "desc", "d", "", "New issue description")
|
||||
UpdateCmd.Flags().StringVarP(&updateFlags.status, "status", "s", "", "New issue status(open, closed, in_progress)")
|
||||
UpdateCmd.Flags().StringVarP(&updateFlags.issueType, "type", "t", "", "New issue type(bug, feature, task)")
|
||||
UpdateCmd.Flags().IntVarP(&updateFlags.priority, "priority", "p", 0, "New issue priority(0-5)")
|
||||
UpdateCmd.Flags().IntVarP(&updateFlags.priority, "priority", "p", 0, "New issue priority(0-4)")
|
||||
UpdateCmd.Flags().StringVarP(&updateFlags.assignee, "assignee", "a", "", "New issue assignee")
|
||||
|
||||
UpdateCmd.RegisterFlagCompletionFunc("type", shellcomp.CompletionFunc(typeOptions))
|
||||
UpdateCmd.RegisterFlagCompletionFunc("status", shellcomp.CompletionFunc(statusOptions))
|
||||
@@ -93,6 +94,10 @@ func getUpdateValues(cmd *cobra.Command) (map[string]interface{}, error) {
|
||||
updates["priority"] = updateFlags.priority
|
||||
}
|
||||
|
||||
if cmd.Flags().Changed("assignee") {
|
||||
updates["assignee"] = updateFlags.assignee
|
||||
}
|
||||
|
||||
if len(updates) == 0 {
|
||||
return updates, fmt.Errorf("no updates specified")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user