Example custom script to find items having a specific field value #8186070/HEAD / v40 |
Tags:
not added yet
1Example custom script to find tracker items having a specific field valuepackage config.scripts.workflow import com.intland.codebeamer.event.util.VetoException import com.intland.codebeamer.manager.* if (!beforeEvent) { return; // do NOTHING on after-event, everything is handled in the before-event } // Acquiring the cbQL Manager from codeBeamer cbQLManager = applicationContext.getBean(CbQLManager.class) // Parameters of a custom field def projectId = 280 def trackerId = 35774 def fieldProperty = "customField[1]" // Desired value of the custom field def fieldValue = 3 // Query string to find all tracker items having the desired value on the field def cbQL = "project.id IN (${projectId}) AND tracker.id IN (${trackerId}) AND '${trackerId}.${fieldProperty}' = ${fieldValue}" // Extracting the tracker item list trackerItemQueryResult = cbQLManager.runQuery(event.getRequest(), cbQL, new CbQLManager.PagingParams(5, 0)); trackerItemsPage = trackerItemQueryResult.getTrackerItems(); trackerItems = trackerItemsPage.getList(); // Some action throw new VetoException(trackerItems.get(0).toString()) |
Fast Links
![]() codebeamer Overview codebeamer Knowledge Base Services by Intland Software |
This website stores cookies on your computer. These cookies are used to improve your browsing experience, constantly optimize the functionality and content of our website, and help us understand your interests and provide more personalized services to you, both on this website and through other media. With your permission, we and our partners may use precise geolocation data and identification through device scanning. You may click accept to consent to our and our partners’ processing as described above. Please be aware that some processing of your personal data may not require your consent, but you have a right to object to such processing. By using our website, you acknowledge this notice of our cookie practices. By accepting and continuing to browse this site, you agree to this use. Your preferences will apply to this website only.
Note that user-behavior analytics are being captured on this server to improve the Codebeamer user experience.