Skip to content

Instantly share code, notes, and snippets.

@CorneAussems
Last active June 17, 2020 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CorneAussems/ff9c4834ebd1e76e922520fe7f9dc4ce to your computer and use it in GitHub Desktop.
Save CorneAussems/ff9c4834ebd1e76e922520fe7f9dc4ce to your computer and use it in GitHub Desktop.
Valamis Miller bulk javascript
############################################################
# Step 0: Open on Miller page the Javascript console #
############################################################
############################################################
# Step 1 : Find first 50 records with only 1 select option #
############################################################
counter=0;
$('select').each(function() {
if(this.length==1){
counter++;
if(counter>0&&counter<=50){
$(this).parent().parent().find(":checkbox").each(function() {
if( $(this).attr('data-ng-model')!='task.toHide' ){
$(this).click();
}
});
}
}
});
########################################################################
# Step 2 : Find specific issues and select item counting from 1 to 10 #
########################################################################
issue="GEN-190";
select_item=1;
counter=0;
$('tr td:first-child').each(function(index,value) {
if($(this).text()==issue){
counter++;
console.log($(this).text()+"-"+counter);
$(this).parent().find('select>option:eq('+--select_item+')').prop('selected', true);
$(this).parent().find(":checkbox").each(function() {
if( $(this).attr('data-ng-model')!='task.toHide' ){
$(this).click();
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment