guilhemmarchand / TA-jira-service-desk-simple-addon

Atlasian JIRA add-on for Splunk alert actions
11 stars 9 forks source link

Edit "pending" issues #169

Closed poiromaniax closed 1 year ago

poiromaniax commented 1 year ago

Hi

Firstly - thanks for this super useful addon. Its made my life a lot easier!

I have a situation where the custom field was misconfigured in the alert action, and it attempted to create tickets into an epic that didnt exist.

I have fixed the alert action, but I can see that I have a bunch of "pending creation" issues that will continuously fail because they are still attempting to use the wrong customfield

Is there any way to edit these pending events to fix the customfield? I would really like to have these tickets created without having to mess around with the alert criteria.

Thanks!

guilhemmarchand commented 1 year ago

Hi @poiromaniax You are welcome ;-)

Just clear out the replay KVstore, run the following search:

| outputlookup jira_failures_replay
poiromaniax commented 1 year ago

@guilhemmarchand that will delete them completely right?

There is a backlog there going back a couple of days, which means I would lose those pending tickets as the alert wont create them again

guilhemmarchand commented 1 year ago

Sorry I've read quickly

You can just edit the KV records with the lookup editor in do it in SPL:

| inputlokup jira_failures_replay | eval key=_key
| rex field=myfield mode=sed "s/mybadvalue/mygoodvalue/g"
| outputlookup jira_failures_replay append=t key_field=key

This is an example using rex, could be with eval etc

poiromaniax commented 1 year ago

Thanks - I tried with that example, by modifying it like so:

| inputlookup jira_failures_replay | eval key=_key
| rex field=fields.project.customfield_10008 mode=sed "s/IS-7531/IS-7530/g"
| outputlookup jira_failures_replay append=t key_field=key

I havent found the correct "syntax" to use to modify the field. (what I posted above is the last thing I tried) You can see the field Im trying to change at the bottom, but doesnt seem to be doing anything image

guilhemmarchand commented 1 year ago

@poiromaniax

The field should not be called with dots in it

This is the list of fields you should see from the inputlookup:

account, data, status, ctime, mtime, no_attempts

Basically this is data that contains the REST call representation - if you see fields with dots then something unexpected happened with the custom field structure and better flushing the KVstore (the original outputlookup)

poiromaniax commented 1 year ago

@guilhemmarchand aaaahhhhh got it.

Thanks for that - successfully changed it now (data field) and it should create them on next retry! Much appreciated