Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for search command arguments and JQL queries #261

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dericksonmark
Copy link
Member

@dericksonmark dericksonmark commented May 13, 2022

Purpose

A much better (I think) version of #241. This allows arguments and JQL queries to be used within the !jira search command. This also fixes up a few other things with the search command, such as the "No results found" message not being displayed when no results were found as a result of executing a search. Additionally, this adds the JQL query used into the embed, and adds the total number of results found into the title of the embed.

Approach

First, the modifiers are grouped together. Then, if one of the modifiers is :jql, the text following it is used as the JQL query. However, if :jql is not present, the modifiers will be used in building the query. A modifier is built with a hyphen or an underscore preceding a field name or a field shortcut (for fields like Mojang Priority, this is "mp" [these have been manually added in the config]). When using an underscore, the modifier is directly paired with its argument. However, when using a hyphen, the modifier is paired with its argument, and then the clause is negated. Finally, any text not part of a modifier is treated as text ~ <content>, allowing classic search features to continue to function.

Additionally, some custom search clauses have been implemented:

  • _commenter uses issueFunction in commented("by <arg>")
  • _transitionedby uses status changed by <arg>

Searches are automatically ordered by created, updated DESC.

An example of a valid command:
!jira search _transitionedby violine1101 -resolution Unresolved _commenter "Darth Cobby"
This searches with this query:
status changed by violine1101 AND resolution != Unresolved AND issueFunction in commented("by \"Darth Cobby\"") ORDER BY created, updated DESC

@dericksonmark dericksonmark linked an issue Jul 1, 2022 that may be closed by this pull request
@dericksonmark dericksonmark marked this pull request as draft August 14, 2022 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more features to !jira search
1 participant