All Apps and Add-ons

Add-on for JIRA: Why am I getting errors searching for filters using jirasoap and jirarest?

Lazarix
Communicator

So I've tried searching for filters in two ways, and both have different errors:

|jirasoap issues "Engineering Blocker issues"

error:

command="jirasoap", Server raised fault: 'java.lang.NumberFormatException: For input string: "Engineering Blocker issues"'

And

|jirarest issues "Engineering Blocker issues"

error:

HTTP Error 505: HTTP Version Not Supported

My jira instance happens to be using http on port 8080 instead of https on 443.

I can, however, search jql using jirasoap properly, and it has statistics and everything for auto tabling, which jirarest doesn't seem to have without adding a |table * at the end, but that's by the by,

Any ideas about the above?

0 Karma

Flynt
Splunk Employee
Splunk Employee

Unfortunately you can't use filters using the Name of the filter (the API expects an ID). You'll have to determine the Id of the filter by running |jirarest filters |table * and finding the Id of the filter you want (you can also find this in the URL if you're pulling up a filter in JIRA itself).

Once that is done , you can invoke the filter with |jirarest issues YOURFILTERNUMBER|table *

For example if "Engineering Blocker issues" had an ID of 12345

|jirarest issues 12345|table *

0 Karma

Lazarix
Communicator

I did mention "I can, however, search jql using jirasoap properly, and it has statistics and everything for auto tabling, which jirarest doesn't seem to have without adding a |table * at the end, but that's by the by,"

The following commands don't work:
| jirarest issues 13576
| jirasoap issues 13576

error: "command="jirasoap", Server raised fault: 'com.atlassian.jira.rpc.exception.RemoteValidationException: Could not find search request with id: 13576"
jirarest version returns no results.

The following commands return no results:
| jirarest filters | table *
| jirasoap filters | table *

The only command that seems to work for me is a raw jqlsearch command:

| jirarest jqlsearch "component = PEV OR component = "PEV CPG" OR component = "PEV QlikView" OR description ~ PEV OR summary ~ PEV AND status != Closed" | table *

So at least something is set up, but most of the functionality is not working. Any ideas what could be missing?

additionally, the jirasoap command in a jqlsearch does not support the OR operator. Any chance of getting this added?

0 Karma

Flynt
Splunk Employee
Splunk Employee

Thanks for the update. A few things to know - The filter command uses the filter/favourite endpoint of the API. This will be filters scoped specifically to the user configured to run the JIRA command in Splunk.

The first thing I would check is to see if the filters are being seen in the API itself for that user. You can do this outside of the command by running a curl statement to the API like this from a command line

curl -D- -u yourjirauser:yourjirapassword -X GET https://yourjirainstance/rest/api/2/filter/favourite?expand

Note that you'll need to sub your user, password and correct instance location.

Another note on the syntax for jqlsearch. Please note the answers post here - http://answers.splunk.com/answers/209171/add-on-for-jira-how-to-add-multiple-fields-to-init.html

| jirarest jqlsearch "component = PEV OR component = "PEV CPG" OR component = "PEV QlikView" OR description ~ PEV OR summary ~ PEV AND status != Closed" | table *

Would search only this in JIRA - "component = PEV OR component = " and not the whole statement. This is because each set of quotes is seen as a separate option to the command. In order to search your whole statement you'll need to enclose the statement in double quotes but the criteria within in single quotes like this -

| jirarest jqlsearch "component = PEV OR component = 'PEV CPG' OR component = 'PEV QlikView' OR description ~ PEV OR summary ~ PEV AND status != Closed" | table *

As far as the jira_soap command, this command is really at a deprecated state as the REST command offers much more in the way of functionality. You are correct that autotable does not behave the same for the REST as it does for SOAP as jirarest brings events back into Splunk as true events and not simply as results.

0 Karma

Lazarix
Communicator

Thanks for the info, Flynt.
Unfortunately, |jirarest filters doesn't return anything and neither does |jirasoap filters

Results of the job inspection below:

Execution costs

Duration (seconds)      Component   Invocations Input count Output count
    0.20    command.jirarest    2   -   -
    0.00    dispatch.check_disk_usage   1   -   -
    0.00    dispatch.createdSearchResultInfrastructure  1   -   -
    0.01    dispatch.evaluate   1   -   -
    0.00    dispatch.evaluate.jirarest  1   -   -
    0.00    dispatch.fetch  2   -   -
    0.00    dispatch.readEventsInResults    1   -   -
    0.00    dispatch.results_combiner   2   -   -
    0.00    dispatch.timeline   2   -   -
    0.01    dispatch.writeStatus    5   -   -
    0.03    startup.configuration   1   -   -
    0.07    startup.handoff 1   -   -
Search job properties

bundleVersion   11468331461722331137
canSummarize    0
createTime  2015-08-25T09:58:12.000+01:00
cursorTime  2038-01-19T03:14:07.000+00:00
custom  
{
    "search": "|jirarest filters"
}
defaultSaveTTL  604800
defaultTTL  600
delegate    None
diskUsage   65536
dispatchState   DONE
doneProgress    1.0
dropCount   0
eai:acl 
{
    "app": "search", 
    "can_write": "1", 
    "modifiable": "1", 
    "owner": "admin", 
    "perms": {
        "read": [
            "admin"
        ], 
        "write": [
            "admin"
        ]
    }, 
    "sharing": "global", 
    "ttl": "600"
}
earliestTime    1970-01-01T01:00:00.000+01:00
eventAvailableCount 0
eventCount  0
eventFieldCount 0
eventIsStreaming    True
eventIsTruncated    False
eventSearch jirarest filters
eventSorting    none
isBatchModeSearch   False
isDone  True
isFailed    False
isFinalized False
isPaused    False
isPreviewEnabled    True
isRealTimeSearch    False
isRemoteTimeline    False
isSaved False
isSavedSearch   False
isTimeCursored  0
isZombie    False
keywords    None
label   None
modifiedTime    2015-08-25T09:58:26.309+01:00
normalizedSearch    None
numPreviews 0
pid 5967
priority    5
remoteSearch    None
reportSearch    None
request 
{
    "adhoc_search_level": "smart", 
    "auto_cancel": "30", 
    "custom.search": "|jirarest filters", 
    "earliest_time": null, 
    "indexedRealtime": null, 
    "latest_time": null, 
    "preview": "1", 
    "rf": "*", 
    "search": "|jirarest filters", 
    "status_buckets": "300", 
    "ui_dispatch_app": "search"
}
resultCount 0
resultIsStreaming   True
resultPreviewCount  0
runDuration 0.211
runtime 
{
    "auto_cancel": "30", 
    "auto_pause": "0"
}
scanCount   0
search  |jirarest filters
searchCanBeEventType    0
searchProviders 
[]
sid 1440493092.148007
statusBuckets   300
ttl 600
Additional info timeline field summary search.log 
0 Karma

Flynt
Splunk Employee
Splunk Employee

This sounds like the command itself hasn't been configured. Are you behind a proxy? Do any other |jirarest options work? You'll want to make sure config.ini file in the app's bin directory has the correct information for your JIRA instance. If it does and you're still having issues, let me know and I'll reach out to you.

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...