taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
270 stars 163 forks source link

How can I edit an exist journal? #381

Open eunyeuny opened 1 year ago

eunyeuny commented 1 year ago

Hi, I want to edit or delete an exist journal on my readmine, however, issue.update() or issue.setNotes(note); can only add a new notes to my issue... I was searching and found the post(https://www.redmine.org/issues/10171) : When the notes of the journal that does not have the associated journal_details are changed to empty, the journal record is deleted. So I wrote the code like this `RedmineManager mgr = RedmineManagerFactory.createWithApiKey(uri, apiAccessKey); Transport transport = mgr.getTransport();

        Issue issue = mgr.getIssueManager().getIssueById(issueId, Include.journals);

        List<Journal> journalList = new ArrayList<>(issue.getJournals());

        for(Journal journal : journalList){
           if(journal.getId().equals(850180)){
                journal.setNotes("");
           }

        transport.updateObject(issue);`

but how to update jounal in issue? jounal class doesn't implements Identifiable ... so i don't know how to update jounal ..