Questions of a new member

32 views
Skip to first unread message

Matthias Paul Scholz

unread,
Dec 7, 2011, 9:52:58 AM12/7/11
to redmine-ja...@googlegroups.com
Hi Group,

I'm presently working with the Redmine Java API and Alexey hinted me to this mailing list; hence I have chosen to become a member.
That way, I can not only drop questions, but also add documentation to the project Wiki.

Actually, I have some questions related to the challenges I am presently trying to cope with the Redmine API; I could not find solutions to them by studying the API.
Please correct me in case this is not the correct place to ask.

  1. In any instance of Project that I fetched from Redmine via the RedmineManager, the contained list of Tracker objects is always null (relates to issue #85, I guess). Is there another possibilty for now to get a list of existing Trackers via the API?
  2. How can I get a list of existing Status objects for a project (relates to issue #25?)?
  3. Is there some way to upload file attachments to an issue via the Java API?
  4. Is there some way to retrieve all existing Activities for a project (required for adding a TimeEntry)?
  5. Is there some way to retrieve all existing Versions for a project (required for setting the target version of a new issue)?
All this features I'd need for my present project (which is the migration of an existing custom ticketing system to Redmine and attaching an existing email JEE service to Redmine).

Thanks in advance,
  MP



Bruno Medeiros

unread,
Dec 7, 2011, 11:28:44 AM12/7/11
to redmine-ja...@googlegroups.com
Welcome, Matthias!

I'll try to answer some of your questions.

On Wed, Dec 7, 2011 at 12:52, Matthias Paul Scholz <matthias.p...@googlemail.com> wrote:
Hi Group,

I'm presently working with the Redmine Java API and Alexey hinted me to this mailing list; hence I have chosen to become a member.
That way, I can not only drop questions, but also add documentation to the project Wiki.

Actually, I have some questions related to the challenges I am presently trying to cope with the Redmine API; I could not find solutions to them by studying the API.
Please correct me in case this is not the correct place to ask.

  1. In any instance of Project that I fetched from Redmine via the RedmineManager, the contained list of Tracker objects is always null (relates to issue #85, I guess). Is there another possibilty for now to get a list of existing Trackers via the API?
It's available on Redmine 1.3+ (http://www.redmine.org/issues/7181),  don't know if redmine-java-api already supports it. You can search and submit a feature request if you don't find.
  1. How can I get a list of existing Status objects for a project (relates to issue #25?)?
It's available on Redmine REST API from 1.3 on (http://www.redmine.org/issues/7402), don't know if redmine-java-api already uses it. You can search and submit a feature request if you don't find.
 
  1. Is there some way to upload file attachments to an issue via the Java API?
Don't think so, it's not available in Redmine REST API yes (http://www.redmine.org/issues/8171).
 
  1. Is there some way to retrieve all existing Activities for a project (required for adding a TimeEntry)?
It's available on Redmine REST API from 1.1 on (http://www.redmine.org/issues/6823), don't know if redmine-java-api already uses it. You can search and submit a feature request if you don't find.
 
  1. Is there some way to retrieve all existing Versions for a project (required for setting the target version of a new issue)?
It's available on Redmine REST API from 1.3 on (http://www.redmine.org/issues/7403), don't know if redmine-java-api already uses it. You can search and submit a feature request if you don't find.


An (almost) complete list for the Redmine REST is available here: http://www.redmine.org/projects/redmine/wiki/Rest_api, but looking at you project it doesn't seem you can achieve that with Redmine REST API. Maybe you need to go directly to the database. If you want to take a look at this way, maybe this project, made by me, can help you:
http://code.google.com/p/redmine-java-model/
Contact me if you you're interested and we can evolve it!

Bye!

--
BrunoJCM

Maxim Zyukin

unread,
Dec 7, 2011, 12:07:30 PM12/7/11
to redmine-ja...@googlegroups.com
Hi, Matthias.

Welcome!

Alexey Skor

unread,
Dec 7, 2011, 12:36:17 PM12/7/11
to redmine-ja...@googlegroups.com
Hi! see my comments inside.

On Wed, Dec 7, 2011 at 6:52 AM, Matthias Paul Scholz <matthias.p...@googlemail.com> wrote:
  1. In any instance of Project that I fetched from Redmine via the RedmineManager, the contained list of Tracker objects is always null (relates to issue #85, I guess). Is there another possibilty for now to get a list of existing Trackers via the API?
 
  1. How can I get a list of existing Status objects for a project (relates to issue #25?)?

  1. Is there some way to upload file attachments to an issue via the Java API?

 
  1. Is there some way to retrieve all existing Activities for a project (required for adding a TimeEntry)?

not supported by Redmine REST API. Feel free to submit a request to their bug tracker: http://www.redmine.org/projects/redmine/issues
when they implement this feature, we can add this to the Java library. 

  1. Is there some way to retrieve all existing Versions for a project (required for setting the target version of a new issue)?

Matthias Paul Scholz

unread,
Dec 8, 2011, 4:16:20 AM12/8/11
to redmine-ja...@googlegroups.com
Hi Alexey, Maxim and Bruno,

Thanks for the quick reply.

2011/12/7 Alexey Skor <als...@gmail.com>:


>> a list of existing Trackers via the API?
> use http://code.google.com/p/redmine-java-api/issues/detail?id=31

The workaround with using getProject() worked for me. Thanks.

> or help us to
> implement [different issue]

Generally speaking, no reservations with doing some implementations
from my side, but I'd have to talk to my boss to get time for that.
Are we talking of efforts in terms of days, weeks or months here?

>> Is there some way to retrieve all existing Activities for a project
>> (required for adding a TimeEntry)?
> not supported by Redmine REST API. Feel free to submit a request to their
> bug tracker: http://www.redmine.org/projects/redmine/issues
> when they implement this feature, we can add this to the Java library.

I'll add an issue; for now I will have to find a workaround to get the
IDs of the activities.

Other point: Any reservations from your side with me enhancing the WIKI entries?

Alexey Skor

unread,
Dec 8, 2011, 9:31:54 PM12/8/11
to redmine-ja...@googlegroups.com
you're very welcome to improve the Wiki pages.

implementing changes for the API should only take an hour or two per request at the most (including time for writing tests, of course) - that's when you already know the source code. which is easy to learn since the codebase is very small and quite consistent.
don't forget the main rule - all new features or bugfixes  must have tests.
--
Alex

Bruno Medeiros

unread,
Dec 9, 2011, 8:27:20 AM12/9/11
to redmine-ja...@googlegroups.com
Some considerations:

 
  1. Is there some way to upload file attachments to an issue via the Java API?


AFAIK the Rest API for attachments is read-only, so you cannot upload files yet (or it's not documented). As I said, there is an open issue for that, http://www.redmine.org/issues/8171, so don't think we can implement redmine-java-api#42

 
  1. Is there some way to retrieve all existing Activities for a project (required for adding a TimeEntry)?

not supported by Redmine REST API. Feel free to submit a request to their bug tracker: http://www.redmine.org/projects/redmine/issues
when they implement this feature, we can add this to the Java library. 

If you're interested in all activities then you really need to fill a feature request, but if you're interested only in Time Entries there is an API for that, as I mentioned before: http://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries

Thanks,

--
BrunoJCM

Matthias Paul Scholz

unread,
Dec 12, 2011, 3:25:44 AM12/12/11
to redmine-java-api-dev
Hi Alexey,

I got the "Go" to do some work here. :)
Would you like to add me as a committer?

Best,
MP

Alexey Skor

unread,
Dec 12, 2011, 1:22:23 PM12/12/11
to redmine-ja...@googlegroups.com, Matthias Paul Scholz
This is great news. I'm happy you can help us.
Can you please send your first several changesets as patches to the mail list? We'll review and commit them. If everything goes well, I'll give you the commit rights.

Welcome!

Alexey.
--
Alex

Matthias Paul Scholz

unread,
Dec 13, 2011, 9:43:11 AM12/13/11
to redmine-java-api-dev
What means "sending as a patch" exactly?
I have created an archive with the sources I have changed - do I just
attach that to a mail to the mailing list?

Bruno Medeiros

unread,
Dec 13, 2011, 9:50:19 AM12/13/11
to redmine-ja...@googlegroups.com
Matthias,

The patch is a format where you can send only what you've changed, so the developers can just "apply" it and have the same changes you've made in their workspace.

You can create them in the command line, something like 'svn diff > mymodifications.patch' or using eclipse. In the latter you can go to the project you have changed, right click, team, create patch and save it to a file.

Having done it, you can send Alexey the patch.

Thanks,
--
BrunoJCM

Matthias Paul Scholz

unread,
Dec 13, 2011, 10:10:26 AM12/13/11
to redmine-java-api-dev
Thanks Bruno.
So I did.

Alexey Skor

unread,
Dec 13, 2011, 1:09:38 PM12/13/11
to redmine-ja...@googlegroups.com
Bruno is right. In addition to that: it is important to keep logically separate changes in separate patches. Consider every patch a potential VCS commit. you don't want to mix unrelated changes in the same commit.
--
Alex

Matthias Paul Scholz

unread,
Dec 14, 2011, 10:01:36 AM12/14/11
to redmine-java-api-dev
Hi Bruno,

On 9 Dez., 14:27, Bruno Medeiros <bruno...@gmail.com> wrote:
> If you're interested in all activities then you really need to fill a
> feature request, but if you're interested only in Time Entries there is an
> API for that, as I mentioned before:http://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries

The problem is that (unless there is a default activity defined in
Redmine) one needs to provide an activity ID to create a new
TimeEntry.
Yet, there seems to be no way currently to fetch activity IDs via the
Redmine REST API.

Matthias Paul Scholz

unread,
Dec 14, 2011, 11:52:24 AM12/14/11
to redmine-java-api-dev
I'd agree with Bruno here: when looking into the according Redmine
issue (http://www.redmine.org/issues/8171) and the Wiki doc (http://
www.redmine.org/projects/redmine/wiki/Rest_Attachments) , apparently
the upload part is not implemented in Redmine 1.3 REST API.
The target version of the issue is set to "Candidate for next MAJOR
release", so we will have to wait quite some time until we are able to
use it with the Redmine Java API... :(

I'm afraid I will have to think of a another solution for file
uploading here.

On 9 Dez., 14:27, Bruno Medeiros <bruno...@gmail.com> wrote:

> AFAIK the Rest API for attachments is read-only, so you cannot upload files

> yet (or it's not documented). As I said, there is an open issue for that,http://www.redmine.org/issues/8171, so don't think we can implement
> redmine-java-api#42
>

sucha...@strandls.com

unread,
Jul 14, 2014, 11:48:50 PM7/14/14
to redmine-ja...@googlegroups.com, matthias.p...@googlemail.com
Iam new to Redmine.

Need help in attaching documents to Redmine Issue using Redmine Java API.

Iam using following versions

1:Redmine installation : 2.5.1
2:Redmine Java API : 1.24

When I try to attach a file using API and print attachment, I get to see following

/uploads.json?key=f41a01d9e015ea13e9bdec66582bcdaef78b4dbf HTTP/1.1
Attachment ::IssueAttachment{id=null, fileName='test.bin', fileSize=0, contentType='application/ternary', contentURL='null', description='null', createdOn=null, author=null, token=1.}

It is not creating/uploading file in "redmine/files" directory

Need help to fix this.

Thanks & Regards,
Sucharitha.
Reply all
Reply to author
Forward
0 new messages