Skip to end of banner
Go to start of banner

Filter Administration Functions

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

This section contains functions that enable users to handle filters, including creating, updating and sharing them. Also the filter event function

Functions Summary

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 notes

Type must be one of the following:

  • "user" - object must be the accountId

  • "group" - object must be groupid

  • "project" - object must be projectKey

  • "projectRole" - object must have this form projectKey|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; //share

Example 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);
  • No labels