-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_watcher_when_change_tracker #145
Comments
Hi @ebergu78 It does not appear to be possible to add a Watcher by editing the issue. The REST API may be used to add the Watcher itself. However, it is going to be complicated. Thanks. |
Hi @onozaty I have modified my code .. // Path pattern: /issues/ $(function() { $('#issue-form input[type="submit"]') var trackerId = $('#issue_tracker_id').val(); switch(trackerId) {
} |
Hi @ebergu78 Is REST web service enabled? |
hi @onozaty :) The REST web service is enabled 1- I edit the issue Thanks for your time |
I am concerned about the content of the Thanks. |
If I change the type, the code still shows the alert :( this code works: $(function() {
}); |
What is the nature of the error? |
What does the alert dialog show? |
Thank you very much. I am a little concerned about the error at the end of the console log. Thanks. |
I disabled another js code that was running |
Can you tell me the entire code again? |
Path pattern /issues/
|
No errors occurred, but I was concerned that it was reloading at the same time it was submitting. $(function() {
$('#issue-form').on('submit', async function(event) {
var trackerId = $('#issue_tracker_id').val();
var issueId = ViewCustomize.context.issue.id;
// setTimeout(function() {
switch(trackerId) {
case '26':
case '28':
await new Promise((resolve, reject) => {
$.ajax({
type: 'POST',
url: '/issues/' + issueId + '/watchers.json',
headers: {
'X-Redmine-API-Key': ViewCustomize.context.user.apiKey
},
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({
'user_id': 15
})
})
.done(function(data) {
// Watcher agregado correctamente, recargar la página
resolve();
})
.fail(function(jqXHR, textStatus, errorThrown) {
// Si hay error en agregar el watcher
reject('Agregar a xxxxx como Seguidor: ' + textStatus + ' -errorThrown: [' + errorThrown + '] -jqXHR: [' + jqXHR.responseText + ']');
});
}).catch(err => alert(err));
break;
}
// }, 1); //con setTimeout, funciona!!!
});
}); |
Hi @onozaty :)
I need add a group as a watcher when editing a issue and when the tracker is changed
$('#issue_watcher_user_ids_15 input').prop('checked', true); -> doesn't work when editing a issue :(
the HTML structure is different ...
Can you help me?
thank you
I need ->
The text was updated successfully, but these errors were encountered: