Filter Administration Functions
This section contains functions that enable users to handle filters, including creating, updating and sharing them. Also the filter event function
Functions Summary
- admChangeFilterOwner — Changes the owner of the filter.
- admCreateFilter — Creates a filter.
- admDeleteFilter — Deletes a filter.
- admFavourFilter — Marks filter as favourite.
- admGetAllFilters — Gets all the filter.
- admGetAllOwnedFilters — Gets all the filter for an user.
- admGetFavouriteFilters — Gets all favourite filter for an user.
- admGetFilterById — Filter by id.
- admGetFilterOwner — Retrieves the owner of the filter.
- admGetFiltersByName — Gets all the filters matching a name.
- admGetFiltersForProject — Gets all the filters matching a project in the share list.
- admShareFilter — Shares a filter.
- admUnfavourFilter — Marks filter as non-favourite.
- admUnshareFilter — Un-Shares a filter.
- admUpdateFilter — Updates a filter.
Structures used in cloud:
JSharePermission
int id; // the id of the permission
string type; // the type of the permission
string object; //the corresponding object id, see notesType must be one of the following:
"user"- object must be theaccountId"group"- object must begroupid"project"- object must beprojectKey"projectRole"- object must have this formprojectKey|roleId"global"- object value is discarded"loggedin"- object value is discarded
See below example on usage
JFilter
int id; //id of the filter
string jql; // the jql
string name; //must be unique in your Jira
string description; // just a description, optional
string owner; // account id of the owner
JSharePermission [] editPermissions; //edit
JSharePermission [] sharePermissions; //shareExample usage
//create a filter
JFilter f = admCreateFilter("pcfilter", "project = TEST and issueType = Bug", currentUser(), "This is programatically created");
//get it's owner
string owner = admGetFilterOwner(f.id);
//update the filter
f.description = "Modified description";
f.name="pcfiltertwo";
admUpdateFilter(f);
//update various bits
admChangeFilterOwner(f.id, someOtherUser);
admFavourFilter(f.id, currentUser());
//Get filters in different ways
f = admGetFilterById(f.id);
JFilter [] allFilters = admGetAllFilters();
JFilter [] namedFilters = admGetFiltersByName("pcfiltertwo");
JFilter [] owned = admGetAllOwnedFilters(currentUser());
//Share a filter:
JSharePermission perm;
perm.type="project";
perm.object="TEST";
admShareFilter(f.id, 1, perm);
perm.type="group";
perm.object="site-admins";
admShareFilter(f.id, 1, perm);
Peacock
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.
