https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292020-05-09T19:51:14ZRedmineRedmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=977452020-05-09T19:51:14ZRobert Korulczyk
<ul></ul><p>+1. I miss this feature so much...</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=978332020-05-16T02:20:59ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=983672020-06-25T13:08:06ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/29272">Feature #29272</a>: Create several relations at the same time via Issue Relations API</i> added</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=991572020-09-13T02:15:22ZGo MAEDA
<ul><li><strong>Category</strong> set to <i>Issues</i></li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=993072020-09-29T08:23:37ZGo MAEDA
<ul></ul><p>I tried out the patch and found it really nice.</p>
<p>The only one small issue of the patch is that issue auto-complete feature does not work. But I think we can resolve it by using Tribute.js which is used for inline auto complete feature (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Inline issue auto complete (#) in fields with text-formatting enabled (Closed)" href="https://www.redmine.org/issues/31989">#31989</a>).</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=994702020-10-20T04:24:35ZGo MAEDA
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>The only one small issue of the patch is that issue auto-complete feature does not work. But I think we can resolve it by using Tribute.js which is used for inline auto complete feature (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Inline issue auto complete (#) in fields with text-formatting enabled (Closed)" href="https://www.redmine.org/issues/31989">#31989</a>).</p>
</blockquote>
<p>I realized that implementing the feature with Tribute.js is not so easy because the auto-complete should be triggered without typing a preceding "#" in the related issues section.</p>
<p>Now I think it is OK even if the feature does not support auto-comple for multiple issue ids because it is a trivial matter compared to the usefulness of this feature.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1000262020-12-06T00:37:43ZMarius BĂLTEANU
<ul><li><strong>Assignee</strong> set to <i>Marius BĂLTEANU</i></li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1001552020-12-12T11:08:34ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0002-Allow-issue-relation-autocomplete-to-select-multiple.patch</i> added</li><li><strong>File</strong> <a href="/attachments/26427">0001-Rework-patch-from-33418.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/26427/0001-Rework-patch-from-33418.patch">0001-Rework-patch-from-33418.patch</a> added</li></ul><p>Dmitry, thanks for posting the patch. I find this feature really useful.</p>
<p>Regarding your proposed solution, I don't think that it's a good ideea to remove the validation from the model because it will allow setting a non visible issue if you by-pass the controller (from a plugin, for example).</p>
<p>I'm attaching two patches:</p>
<p><strong>1. 0001-Rework-patch-from-33418.patch</strong><br />Based on the existing patch, but keeping the validation in the model and also fixes some edge-case bugs (for ex: no error if you press Add without typing the issue id).</p>
<p><strong>2. 0002-Allow-issue-relation-autocomplete-to-select-multiple</strong><br />Adds a new JS autocomplete function that allows searching for multiple values. If the solution is good enough, I'll add a system test for it.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1001752020-12-14T02:49:34ZGo MAEDA
<ul></ul><p>Marius, thank you for improving the patch. I tried out the patches <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Bulk addition of related issues (Closed)" href="https://www.redmine.org/issues/33418#note-8">#33418#note-8</a> and found they are really nice.</p>
<p>Marius BALTEANU wrote:</p>
<blockquote>
<p><strong>2. 0002-Allow-issue-relation-autocomplete-to-select-multiple</strong><br />Adds a new JS autocomplete function that allows searching for multiple values. If the solution is good enough, I'll add a system test for it.</p>
</blockquote>
<p>I didn't feel strange compared to the autocomplete in Redmine 4.1.0.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1002192020-12-16T23:15:35ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0002-Allow-issue-relation-autocomplete-to-select-multiple.patch</i></del>)</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1002202020-12-16T23:16:37ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/26437">0002-Allow-issue-relation-autocomplete-to-select-multiple.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/26437/0002-Allow-issue-relation-autocomplete-to-select-multiple.patch">0002-Allow-issue-relation-autocomplete-to-select-multiple.patch</a> added</li><li><strong>Assignee</strong> deleted (<del><i>Marius BĂLTEANU</i></del>)</li><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>4.2.0</i></li></ul><p>Updated the second patch to include a test.</p>
<p>Let's discuss this for <a class="version" href="https://www.redmine.org/versions/152">4.2.0</a>.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1003132020-12-25T02:32:43ZGo MAEDA
<ul><li><strong>Tracker</strong> changed from <i>Patch</i> to <i>Feature</i></li><li><strong>Subject</strong> changed from <i>Issue relation bulk create</i> to <i>Bulk addition of related issues</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed the patch. Thank you for improving Redmine.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1003152020-12-25T04:34:54ZGo MAEDA
<ul><li><strong>Related to</strong> deleted (<i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/29272">Feature #29272</a>: Create several relations at the same time via Issue Relations API</i>)</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1003172020-12-25T04:35:12ZGo MAEDA
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/29272">Feature #29272</a>: Create several relations at the same time via Issue Relations API</i> added</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1003192020-12-25T04:36:45ZGo MAEDA
<ul><li><strong>Has duplicate</strong> deleted (<i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/29272">Feature #29272</a>: Create several relations at the same time via Issue Relations API</i>)</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1003212020-12-25T04:36:58ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/29272">Feature #29272</a>: Create several relations at the same time via Issue Relations API</i> added</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1003452020-12-26T13:12:45ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/26477">accept_issue_to_id_as_array.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/26477/accept_issue_to_id_as_array.patch">accept_issue_to_id_as_array.patch</a> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li><li><strong>Assignee</strong> deleted (<del><i>Go MAEDA</i></del>)</li></ul><p>I'm reopening this to discuss about the API part which is not implemented 100% correctly.</p>
<p><strong>1. Request:</strong><br />Currently, for bulk addition of related issues, the request should contains the ids as comma-delimited string, please see the below example (param <code>issue_to_id</code>):</p>
<pre><code class="ruby syntaxhl"><span class="n">post</span><span class="p">(</span>
<span class="s1">'/issues/2/relations.xml'</span><span class="p">,</span>
<span class="ss">:params</span> <span class="o">=></span> <span class="p">{</span><span class="ss">:relation</span> <span class="o">=></span> <span class="p">{</span><span class="ss">:issue_to_id</span> <span class="o">=></span> <span class="s2">"7, 8"</span><span class="p">,</span> <span class="ss">:relation_type</span> <span class="o">=></span> <span class="s1">'relates'</span><span class="p">}}</span>
<span class="p">)</span>
</code></pre>
<p>I think we should accept also an array of ids:<br /><pre><code class="ruby syntaxhl"><span class="n">post</span><span class="p">(</span>
<span class="s1">'/issues/2/relations.xml'</span><span class="p">,</span>
<span class="ss">:params</span> <span class="o">=></span> <span class="p">{</span><span class="ss">:relation</span> <span class="o">=></span> <span class="p">{</span><span class="ss">:issue_to_id</span> <span class="o">=></span> <span class="p">[</span><span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">],</span> <span class="ss">:relation_type</span> <span class="o">=></span> <span class="s1">'relates'</span><span class="p">}}</span>
<span class="p">)</span>
</code></pre></p>
<p>The attached patch allows this.</p>
<p><strong>2. Response:</strong><br />Currently, the response contain only the latest relation added:<br /><pre>
{
"relation": {
"id": 107,
"issue_id": 2,
"issue_to_id": 8,
"relation_type": "relates",
"delay": null
}
}
</pre></p>
<p>I think the response should contain all the created relations:<br /><pre>
{
"relations": [
{
"id": 114,
"issue_id": 2,
"issue_to_id": 7,
"relation_type": "relates",
"delay": null
},
{
"id": 115,
"issue_id": 2,
"issue_to_id": 8,
"relation_type": "relates",
"delay": null
}
]
}
</pre></p>
<p>but I'm not sure how to handle the case when the response contain both successfully created relations and non-successfully relations. From what I know, we don't have this kind of mixed API response in Redmine.</p>
<p>I see two options:<br />1. We change the current implementation to be transactional. In this way, we reject the entire request if an error occurs. <br />2. We respond with succes if at least one relation was created successfully and we append the error messages to the response:<br /><pre>
{
"relations": [
{
"id": 114,
"issue_id": 2,
"issue_to_id": 7,
"relation_type": "relates",
"delay": null
},
{
"id": 115,
"issue_id": 2,
"issue_to_id": 8,
"relation_type": "relates",
"delay": null
}
],
"errors": [
"Related issue has already been taken: #3",
]
}
</pre></p>
<p>Any feedback is welcome!</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1014982021-03-23T06:28:12ZMarius BĂLTEANU
<ul><li><strong>Assignee</strong> set to <i>Marius BĂLTEANU</i></li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1015642021-03-27T06:55:32ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>We will postpone the fixes for API to another version.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1018402021-04-05T17:02:41ZAlex Last
<ul></ul><p>hi everyone! I am the owner of redmine-java-api project (<a class="external" href="https://github.com/taskadapter/redmine-java-api">https://github.com/taskadapter/redmine-java-api</a>).<br />I get a server error with Redmine 4.2.0 when trying to create a relation with the request body that previously worked for Redmine 3.x:</p>
<pre>
{"relation"=>{"issue_to_id"=>576, "relation_type"=>"relates"}, "issue_id"=>"575"}
</pre>
<p>the error is:</p>
<pre>
NoMethodError (undefined method `split' for 576:Integer):
</pre>
<p>because <strong>issue_to_id</strong> is now expected to be a string with commas, instead of a number.</p>
<p>is this a permanent change or just an experiment? it would be too expensive to maintain compatibility for multiple redmine versions in the java library.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1018412021-04-05T17:21:19ZAlex Last
<ul></ul><p>side note - if Redmine REST API supported returning some "server info", the clients could at least choose what json blob to send (for redmine 3.x, 4.x, etc). but since this is not supported, there is no good way to support several redmine REST formats in clients.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1018432021-04-05T19:30:56ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/35039">Defect #35039</a>: API create issue relation method returns undefined method `split' when issue id is sent as integer</i> added</li></ul> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1018442021-04-05T19:33:17ZMarius BĂLTEANU
<ul></ul><p>Thanks Alex Last for reporting this issue. It's a defect, I've created <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: API create issue relation method returns undefined method `split' when issue id is sent as integer (Closed)" href="https://www.redmine.org/issues/35039">#35039</a> to track this, the fix will be available in <a class="version" href="https://www.redmine.org/versions/165">4.2.1</a>.</p> Redmine - Feature #33418: Bulk addition of related issueshttps://www.redmine.org/issues/33418?journal_id=1034802021-08-01T13:41:45ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/35655">Defect #35655</a>: Create duplicated follows relations fails with 500 internal error</i> added</li></ul>