How to update my Insight Object with Jira custom field info in workflow Post Function

Lara Arthur
Contributor
March 20, 2019

I've seen this answered a few times but I'm still unable to get this to actually change anything in Insight. 

Here is what I have in JIRA:

SQL to analyze.JPG

1. SQL Statement Requiring Analysis = 13945 // Insight Field

2. Approved SQL Status = 13909 // Jira field

3. Retired Date = 13916 // Jira field 

From the Jira workflow, I want upon transition to SQL RETIRED the Insight object to update from ACTIVE to RETIRED and for it to populate the Retired Date.

approved sql object.JPG

 

Insight attributes are:

Status; ID = 3448

Date Retired; ID = 3423

 

I've only attempted to update the STATUS field and haven't been able to get updates in Insight. No idea what I'm doing wrong here. I'm using the answer provided here: https://community.atlassian.com/t5/Marketplace-Apps-questions/Update-Insight-Object-using-Groovy-Post-Function/qaq-p/1029354

as a template but no dice.

and adding here:

Insight post function.JPG

Can someone please assist and let me know what field ids/ insight id's I should be putting where? No matter what I do I get nada

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Yinon Negev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2019

Hi Lara.

     It seems like the postfunction is not working for you because of the Groovy Condition, which should return True or otherwise it is considered to be "False"

Tested here for a POC, the Postfunction works fine when using 3 Insight Postfunction with No Groovy condition, a Date Attribute, Select List Attribute and a Status type Attribute, and all 3 were updated accordingly.

Please test the postfunction without a Groovy condition, or add "return true" when needed (se example here)

Please feel free to reach out to us using our Support Portal if you require our assistance.

Kind regards,

Yinon

Team Riada

Lara Arthur
Contributor
March 28, 2019

Thank you Yinon...not quite sure how I messed that one up! Working perfectly now.

Lara Arthur
Contributor
March 28, 2019

Actually, one more question on this.

One of the fields I'm trying to update is a date field. How would I capture that in the Change value field? 

I plugged in %%CURRENT_DATETIME%% on the off chance it would work...but it did not.

Christof Hurst
Contributor
September 15, 2022

You can set a date by e.g. using the ticket updated date with 

${updated}

Reference: https://confluence.atlassian.com/display/SERVICEMANAGEMENTSERVER0422/Advanced%3A+Placeholders

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events