Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can we monitor number of objects for particular object type?

Dharmin Patel April 24, 2024

Hi All,

We have imported our AWS resources into JSM Assets (Data center). We want to monitor particular object type (VPC Links) to be monitored so that  it does not reach our limit. Can we track/monitor the same and we get notification/email regarding it.

Thanks & Regards,

Dharmin Patel

1 answer

1 accepted

2 votes
Answer accepted
Stefan Stadler April 24, 2024

Hi Dharmin,

I am not sure you can achieve that with Jira base utilities as there is no way (as far as I know) to get the count of Asset objects returned by an AQL.

You could achieve this with a Groovy script similar to the following:

import com.atlassian.jira.component.ComponentAccessor
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.IQLFacade

IQLFacade iqlFacade = ComponentAccessor.getOSGiComponentInstanceOfType(IQLFacade)
String aql = "Type your AQL here"
iqlFacade.findObjects(aql).size()

As you can see the findObjects method returns a list of ObjectBean objects. So you can simply use the size method to get the number you want to have.

You would have to store the script in your instance directories so that you can refer to the script from an object scheme automation (Object Schema > Configure > Automation), set a schedule of your choice as trigger and use the Groovy script as an action.

That way it is possible for us to achieve similar things.

Hope this helps!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events