Hello everyone,
I'm asking a question because I need help
For my java project, I need to import a bitbucket project. I'm doing it now with:
Process proc=null;
Runtime r= Runtime.getRuntime();
proc=r.exec("git clone https://MYACCOUNT:PWD@bitbucket.org/XXXX/XXX.git XXX");
And it works!
but i would like to make sure the java client can import without having git already installed.
I searched on: https://developer.atlassian.com/bitbucket/api/2/reference/
and even on the net but I do not find how I could implement between bitbucket server and java client.
PLEASE can someone explain me how to communicate between my java program andbitbucket
thank you in advance
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.ComponentAccessor
import com.atlassian.jira.issue.worklog.Worklog
def issue = context.issue as Issue
def workLogManager = ComponentAccessor.getWorklogManager()
//get worklogs for issue
def logsForIssue = workLogManager.getByIssue(issue)
//draw a table via html
String 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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Bart,
1) Yes, it possible
2) You need get worklogs via WorklogManager. and create html code that draw you table
Here is example:
import com.atlassian.jira.issue.*
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.worklog.Worklog
def issue = context.issue as Issue
def workLogManager = ComponentAccessor.getWorklogManager()
//get worklogs for issue
def logsForIssue = workLogManager.getByIssue(issue)
//draw a table via html
String 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 it at atl.jira.view.issue.right.context, it will be looks like:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mark Markov , Is it possible to display the linked issues of particular link type and its status under Web panel? (Script fragment)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, @Bart Geens
1) Yes it possible.
2) You'll need to get worklogs via WorklogManager and create html to draw table, based on worklogs.
Here is an example:
import com.atlassian.jira.issue.*
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.worklog.Worklog
def issue = context.issue as Issue
def workLogManager = ComponentAccessor.getWorklogManager()
//get worklogs for issue
def logsForIssue = workLogManager.getByIssue(issue)
//draw a table via html
String 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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.