When we do a bulk change (change several issues simultaneously), some fields can not be changed if the issues come from several different projects.
I need to have the same behevior for my custom field (plugin). How to do that?
Community moderators have prevented the ability to post new answers.
In your custom field code, override the availableForBulkEdit function to return a string and your custom field will be excluded from bulk edit. If you return empty string or null, then the field will be available for bulk edit.
public class YourCustomCFType extends TextCFType { ... @Override public String availableForBulkEdit(BulkEditBean bulkEditBean) { return "bulk.edit.unavailable"; } }
Thanks a lot Tan Zhi Rong. your solution is the good one!
I 've searched in source of JIRA to find the different values :
And the solution is to add in my custom type
@Override
public String availableForBulkEdit(BulkEditBean bulkEditBean) {
return "bulk.edit.unavailable.multipleprojects";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
bulk.edit.unavailable.multipleprojects = {0}NOTE{1}: This operation can be performed only on issues from ONE project. If that's the message you want.. For your case: "some fields can not be changed if the issues come from several different projects" I think you will need to add extra check conditions for the project and return bulk.edit.unavailable.multipleprojects or null correspondingly: Collection<Project> projects = bulkEditBean.getProjectObjects(); But you might have problem if the bulk edit contains a mix of issues that comes from projects that can and cannot edit...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are right. What have I written is not enought. The good solution is: @Override public String availableForBulkEdit(BulkEditBean bulkEditBean) { if (bulkEditBean.isMultipleProjects()) { // Let the user know that selected issues belong to more than one project so the action is not available return "bulk.edit.unavailable.multipleprojects"; } return null; } and it is working well. If found this solution here: atlassian-jira-6.4.9-source\jira-project\jira-components\jira-core\src\main\java\com\atlassian\jira\issue\customfields\impl\VersionCFType.java
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this out https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner/server/overview (sorry abbreviated links aren't working for some reason). It is much faster in terms of deploying customizable solutions for workflows, custom fields etc instead of full blown plugins. In regards to "limiting" the bulk behavior you must have a defined standard of value/values that would be part of a condition in your code to determine what changes and what doesn't.
What type of custom field is this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.