Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,375
Community Members
 
Community Events
168
Community Groups

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

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

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

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

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.

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

Atlassian Community Events