1) is it possible to use a scriptfragment (web panel) to display the issues worklogs
2) Does anybody have an example on what needs to be in the provider Class/script to display a list of worklogs
thanks
Hello, @Bart Geens
1) Yes it possible.
2) You'll need to get worklogs via WorklogManager and create htlm to draw table, based on worklogs.
Here is example:
import com.atlassian.jira.issue.*import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.worklog.Worklogdef issue = context.issue as Issuedef workLogManager = ComponentAccessor.getWorklogManager()//get worklogs for issuedef logsForIssue = workLogManager.getByIssue(issue)//draw a table via htmlString fin ='<table border=\"1\"><tr><th>Author</th><th>Time Spent</th><th>Created</th></tr>'for(Worklog worklog : logsForIssue){ fin = fin +'<tr><td>'+worklog.getAuthorObject().getDisplayName() + "</td><td>" + worklog.getTimeSpent()/60 +"</td><td>"+ worklog.getCreated().toString() + "</td></tr>"}fin = fin +'</table>'writer.write(fin)
If you locate the panel at atl.jira.view.issue.right.context, it will look like this:
Hello, Bart,
1) Yes, it possible
2) You need get worklogs via WorklogManager. and create html code that draw you tableHere is example:
:
If you locate it at atl.jira.view.issue.right.context, it will be looks like:
2) You'll need to get worklogs via WorklogManager and create html to draw table, based on worklogs.
Here is an example:
Thanks for the example!
Thanks Markov,this works for me
@Mark Markov , Is it possible to display the linked issues of particular link type and its status under Web panel? (Script fragment)
It looks like you're new here. Sign in or register to get started.