Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Generate documents from Insight tables

Hi all,

we are using Jira Service Management with Insight, where we have put user's assets.

I'm looking for a way to generate some company standard documentation based on the data stored in Insight.

I found this plugin:

Is there some way to get data from Insight instead of Jira issues?

2 answers

1 accepted

1 vote
Answer accepted

I resolved using a scriptrunner postfunction that read data from Insight, perform some logic, replace this data in a template with placeholder using SimpleTemplateEngine class and then attach the resulting document to the issue.

The template is in HTML, in this way the assignee can open directly in the browser and print in pdf (with a pdf printer) if it is necessary.

I would love to hear more about how you replaced data in a template with data from Insight

Hi Brandon,

in the scriptrunner postfunction I used something like this:

 

def assetListMap = getAssetMapFromInsightList(insightAssetList, insightObjectSchemaId, adminUsername)

def binding = [

data: new Date().format('dd/MM/yyyy') ,

reporter: issue.reporter.displayName,

assetList: assetListMap

]

def engine = new SimpleTemplateEngine()

def template = engine.createTemplate(templateFile.text).make(binding)
And then I attached the template to the issue.
The binding object can be used in the templateFile and you can iterate in the objects and grab values from them.
For example:
<% for (asset in assetList) { %> 

<tr><td><%= asset.value1 %> <%= asset.value2 %></td></tr>

<% } %>
0 votes

It really depends on what you need and how your data is organized.

Insight has some built-in reporting features (though I haven't explored them much) and some REST APIs.

And if you know what you are doing or are adventurous, you could fetch data directly from the db (though that is not generally recommended).

Some of the bigger/expensive reporting solutions like eazyBI might already understand the Insight data and allow you to generate reports.
But most of the more simple/cheap/free ones like the one you linked probably will not.

Thank you, Peter, but I don't want to create a report from Insight tables.

What I want is to create a new word document, or pdf, using a template filled with data from Insight.

For example, I want to give a new employee a new pc, a monitor and a tablet. I need to create a new document with the assets associated with this new user in Insight, give it to him to sign it, and store it in our archive.

Just use the built-in label template builder

Create a template the size of a full page of paper and print that.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you