Create an attribute type User automatically updated every time is an object modified

Monica Ferrer March 5, 2018

1.1- Is it possible to create an attribute type "User" that every time that the object is modified, the attribute automatically updates the user or users who have modified.

3 answers

2 accepted

1 vote
Answer accepted
Alexander Sundström
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 6, 2018

Hi Monica,

This is something that could be done using automation rules in Insight. That way, you can listen on objects being created and updated, and execute an groovy script.

Basically, what you need to do is to load the objects history and look at the latest changes, and select the user there, and then assign that value to the right attribute (you need an attribute of type user then for the object).

What I can do to help is to point to our documentation where there is one example of where we assign values, that can be used, and also point to our object facade where you can get the history of the objects. We do have some partners that can help with creating such scripts and configure Insight (and Jira if needed), for more information take a look at https://riada.se/partners/

Automation: https://documentation.riada.se/insight/latest/insight-manager-s-guide/insight-automation

Update attribute: https://documentation.riada.se/insight/latest/insight-for-developers/groovy-scripting/groovy-script-examples/automation/update-an-object-attribute

Object Facade, findObjectHistoryBean: https://insight-javadoc.riada.se/insight-javadoc-5.3.1/com/riadalabs/jira/plugins/insight/channel/external/api/facade/ObjectFacade.html#findObjectHistoryBean-int-

History Bean: https://insight-javadoc.riada.se/insight-javadoc-5.3.1/com/riadalabs/jira/plugins/insight/services/model/ObjectHistoryBean.html

Best Regards
Alexander

0 votes
Answer accepted
Monica Ferrer March 8, 2018

Hi Alexander,

That's a good idea. I will try to do this groovy script.

Thank you!!

Alexander Sundström
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 8, 2018

You're more than welcome, if you feel like this answered your question, please mark it as accepted :)

0 votes
Mahesh S
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 5, 2018

Can you please explain with a use case? Not able to understand the attribute user type.

Monica Ferrer March 5, 2018

Sorry, yes, now we can creat an attribute type"User" in order to put the name os specific Jira user. But next time that the object is modified the original user that you put on the attribute remains. The idea would be to have automatically the register of the user that has modified the object the last time. (The same that is shown in the history of the object but having it in an atrribute). Do you understand me?

Suggest an answer

Log in or Sign up to answer