AutoTask Match Criteria

For an overview of AutoTasks and their syntax, see AutoTasks

Match Criteria are the root of all AutoTasks; they dictate the circumstances under which an AutoTask will trigger. Every AutoTask must have at least one Match Criteria element.

matchCriteria type

The matchCriteria type designates whether one or all of the listed criteria must match to trigger the AutoTask. If all listed criteria require a match, it is an and type. If only one of the criteria must match, it is an or type.

and

In the following example, this task will trigger when an asset is uploaded to NetX with the value Fluffy applied to the attribute Texture

Conversely, if an asset is uploaded without the specified value this task will not trigger, nor will it trigger if an asset's Texture attribute is updated to Fluffy after it has been uploaded to NetX. 

<matchCriteria type="and">
    <criteria type="action" value="import"></criteria>
    <criteria name="Texture" type="attribute" value="Fluffy"></criteria>
</matchCriteria>

or

In the following example, the task will trigger if a user's level is changed or there is a change to a user's group; if both criteria are met, the task will also trigger. 

<matchCriteria type="or">
    <criteria type="action" value="userLevelChange"></criteria>
	<criteria type="action" value="userGroupChange"></criteria>
</matchCriteria>

Criteria type

Each criterion must have a type. These types may be used in combination in one AutoTask, or individually in separate tasks. Note that if more than one type is used, the task's matchCriteria type will determine whether all criteria are required in order to trigger the task, or if only one criterion must be met. Types include: 

  • action
  • attribute
  • category
  • group
  • user
Every AutoTask must have at least one action type amidst its criteria.

action

Action-type criteria refer to actions that can be performed in the application, such as uploading new assets, resyncing existing assets, or reorganizing assets amongst existing folders. Criteria that include actions are met when that action is performed by any user in the application regardless of context unless additional criteria are included in the AutoTask. 

Parameters

Parameter Description
offset

The offset parameter adjusts the date criteria for an AutoTask (if used) to include a wider window of time. This parameter is only used for date-based AutoTasks such as date.

Value options: +, -, y, M, w, d, h, m, s

type

To use action parameters, the AutoTask's criterion type must be action

Value options: action

value

The value parameter specifies the type of action being performed. The value options and their effects are enumerated below.

Value options: assetViewDelete, attributeChange, attributeHistory, categoryChange, categoryCreate, categoryDelete, check-in, checkout, date, expire, import, move, reimport, resync, userGroupAdd, userGroupChange, userLevelChange

name

The name parameter is only used with certain action values relating to attributes — such as attributeChange — to specify the name of the attribute being modified. This parameter is not necessary for most AutoTask actions.

Value options: Name of an existing attribute (case sensitive)

Values

assetViewDelete

assetViewDelete criteria are met when one of an asset's views is deleted.

The following AutoTask example uses this action to notify the email address netxautotasks@netx.net when a change is made to the group AutoTask Net; this applies both to adding and removing users. The specified email template determines what type of email is sent to the specified address. 

<task>
	<matchCriteria type="and">
		<criteria type="action" value="assetViewDelete"></criteria>
		<criteria name="AutoTask Net" type="group"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="assetImportReport.tpl" type="email"></notify>
	</notifications>
</task>

attributeChange

attributeChange criteria are met when an attribute's value is edited

The following AutoTask example is triggered once the attribute Watermarked is given the value Yes. Once triggered, the attribute Ready for publication is modified with the value Yes.  

<task>
	<matchCriteria type="and">
		<criteria name="Watermarked" type="action" value="attributeChange"></criteria>
		<criteria name="Watermarked" type="attribute" value="Yes"></criteria>
	</matchCriteria>
	<modifications>
		<modify name="Ready for publication" type="attribute" value="Yes"></modify>
	</modifications>
<task>

attributeHistory

This criteria can not be combined with other criteria. 

attributeHistory criteria are met when a certain number of changes are made to the value of any attribute affected by attribute history

The following AutoTask example uses this action in conjunction with the parameter level. In this context, level 5 triggers the AutoTask when five changes are made to an attribute affected by attribute history. When the AutoTask is triggered, a notification email is sent to  netxautotasks@netx.net with the specified email template.

<task>
	<matchCriteria type="and">
		<criteria type="action" value="attributeHistory" level="5"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="attributeDataImportReport.tpl" type="email"/>
	</notifications>
</task>

categoryChange

This criterion cannot be combined with any other match criteria in the same AutoTask. 

categoryChange criteria are met when a folder is edited or modified in any way. 

The following AutoTask is triggered when a folder is edited. Once triggered, a notification email is sent to netxautotasks@netx.net with the specified email template

<task>
    <matchCriteria type="and">
        <criteria type="action" value="categoryChange"/>
    </matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="healthCheck.tpl" type="email"/>
	</notifications>
</task>

categoryCreate

This criterion cannot be combined with any other match criteria in the same AutoTask. 

categoryCreate criteria are met when a new folder is created

The following AutoTask is triggered when a new folder is created, which sends a notification email to netxautotasks@netx.net with the specified email template.

<task>
	<matchCriteria>
		<criteria type="action" value="categoryCreate"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxqa@netx.net" emailTemplate="newFolder.tpl" type="email"></notify>
	</notifications>
</task>

categoryDelete

This criterion cannot be combined with any other match criteria in the same AutoTask. 

categoryDelete criteria are met when an existing folder is deleted.

The following AutoTask example sends a notification email to netxautotasks@netx.net with the specified email template whenever a subfolder of /Delete me is deleted. 

<task>
	<matchCriteria type="and">
		<criteria type="action" value="categoryDelete"></criteria>
		<criteria path="/Delete me" recursive="true" type="category"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="attributeDataImportReport.tpl" type="email"/>
	</notifications>
</task>

checkin

checkin criteria are met when an asset is checked in during the versioning process.

The following AutoTask example will modify the attribute Versioned with a value of Yes when an asset is checked back into NetX anywhere on your site. 

<task>
	<matchCriteria type="and">
		<criteria type="action" value="checkin"></criteria>
	</matchCriteria>
	<modifications>
		<modify name="Versioned" type="attribute" value="Yes"></modify>
	</modifications>
</task>

checkout

checkout criteria are met when an asset is checked out during the versioning process.

The following AutoTask example will modify the attribute Versioned with the value No when an asset is checked out anywhere in NetX. 

<task>
	<matchCriteria type="and">
		<criteria type="action" value="checkout"></criteria>
	</matchCriteria>
	<modifications>
		<modify name="Versioned" type="attribute" value="No"></modify>
	</modifications>
</task>

date

date criteria are met when the date value of the named attribute matches the date the AutoTask runs; date-based AutoTasks run once a day on a predetermined schedule. For more information on date-based event triggers, see Date-based Event Triggers. Date attributes include any custom date-type attribute, as well as the system attributes modDateimportDate, and creationDate

The following AutoTask example will notify the specified email address of any assets with an import date that matches the date the AutoTask job runs. 

<task>
	<matchCriteria type="and">
		<criteria type="action" value="date" name="importDate"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="assetImportReport.tpl" type="email"/>
	</notifications>
</task>

expire

expire criteria are met when an asset is expired
The following AutoTask example will adjust the asset's visibility to invisible once it is expired in NetX. 

<task>
	<matchCriteria type="and">
		<criteria type="action" value="expire"></criteria>
	</matchCriteria>
	<modifications type="and">
		<modify type="attribute" name="visible" value="false"/>
	</modifications>
</task>

import

import criteria are met when assets are uploaded to NetX. 

The following AutoTask example will generate a watermarked view when an image asset is uploaded to NetX. The repurpose parameters dictate the file type of the new view, the length of the longest side (in pixels), the ID number for the asset used for the watermark, and its opacity settings as it is applied to the image. Once this repurpose process is complete, a new view is created with the task's export parameters.

<task>
	<matchCriteria type="and">
		<criteria type="action" value="import"></criteria>
		<criteria name="fileFormatFamily" type="attribute" value="image"></criteria>
	</matchCriteria>
	<repurpose format="jpg" length="1000" watermarkAssetId="521" watermarkAlpha="45"/>
	<exports>
		<export name="Watermarked view" type="view"/>
	</exports>
</task>

move

move criteria are met when assets are moved in NetX.

The following AutoTask example will trigger, when any asset is moved into the Images folder; note that the full file path from the top level of the application is used. Once moved, the attribute Pretty picture will be modified with the value Yes

<task>
	<matchCriteria type="and">
		<criteria type="action" value="move"></criteria>
		<criteria path="Campaign materials/Images" type="category"></criteria>
	</matchCriteria>
	<modifications>
		<modify type="attribute" name="Pretty picture" value="Yes"/>
	</modifications>
</task>

reimport

reimport criteria are met when assets are reimported into NetX. 

The following AutoTask example will trigger when any asset is reimported into NetX. When triggered, the attribute Reimported will be modified with the value Yes.

<task>
	<matchCriteria>
		<criteria type="action" value="reimport"></criteria>
	</matchCriteria>
	<modifications>
		<modify type="attribute" name="Reimported" value="yes"/>
	</modifications>
</task>

resync

resync criteria are met when assets are resynced into NetX. 

The following AutoTask example will trigger when any asset is resynced into NetX. When an asset is resynced, the attribute Resynced will be modified with the value Yes.

<task>
	<matchCriteria type="and">
		<criteria type="action" value="resync"></criteria>
	</matchCriteria>
	<modifications>
		<modify type="attribute" name="Resynced" value="yes"/>
	</modifications>
</task>

userGroupAdd

userGroupAdd criteria are met when a user is added to a new group.

The following AutoTask example will notify netxautotasks@netx.net with the specified email template when a user is added to the user group AutoTask Net.

<task>
	<matchCriteria type="and">
		<criteria name="AutoTask Net" type="action" value="userGroupAdd"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="notifyAdmin.tpl" type="email"></notify>
	</notifications>
</task>

userGroupChange

userGroupChange criteria are met when a group is modified either by adding or removing users. 

The following AutoTask example will notify netxautotasks@netx.net with the specified email template when a user is added or removed from the user group AutoTask Net.

<task>
	<matchCriteria type="and">
		<criteria name="AutoTask Net" type="action" value="userGroupChange"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="notifyAdmin.tpl" type="email"></notify>
	</notifications>
</task>

userLevelChange

userLevelChange criteria are met when a user's level is modified.

The following AutoTask will notify netxautotasks@netx.net with the specified email template when any user's level is changed to either consumer (2) or importer (3). 

<task>
	<matchCriteria type="or">
			<criteria type="action" value="userLevelChange"></criteria>
			<criteria type="user" level="2"></criteria>
			<criteria type="user" level="3"></criteria>
	</matchCriteria>
	<notifications>
		<notify address="netxautotasks@netx.net" emailTemplate="notifyAdmin.tpl" type="email"/>
	</notifications>
</task>

offset

AutoTasks that trigger based on date criteria run once a day. Offset values may be used to expand the temporal range of the date criteria, e.g. a value of +3d will expand the criteria so that the AutoTask will trigger three days before the value of the specific date attribute. These offset values can be stacked by adding spaces between values, e.g. "1y 2M 5d".

All values are case-sensitive.

Value Description
d day
h hour
m minute; note that this value is case-sensitive
s second
+ / -

To subtract time from the current date, use the modifier, e.g. + 6d subtracts six days.

To add time to the current date, use the - modifier, e.g. -1M adds a month. 

Note that the default for an offset value is + if not specified.

y year
M Month; note that this value is case-sensitive

For more information regarding triggering AutoTasks based on date attributes, see our article on Date-based event triggers

Note that setting an offset will create a date range an asset may match multiple times, which will cause a task to trigger for the same asset over the course of multiple days.

attribute

Match criteria that rely on an attribute-type trigger require two parameters: name and value. The name parameter refers to the name of the attribute the AutoTask will monitor, while the value parameter indicates the value that will trigger the task. If an AutoTask attribute criterion only uses the name parameter, it will trigger whenever that attribute is affected by the action criteria of the AutoTask; if a value parameter is added, the AutoTask will only trigger when the named attribute has a particular value when the action criteria are met. Note that name is a required attribute parameter, but value is not. 

Attribute changes made with attribute profiles or via asset import with embedded metadata will also trigger attribute-based AutoTask criteria.

Parameter Description
type

To use attribute parameters, the AutoTask's criterion type must be attribute.

Value options: attribute

name

The name of the triggering attribute. This must be the exact name of the attribute, including casing.

Value options:

  • Any custom attribute
  • System attributes: fileNamenamefileTypevisible
value

The attribute value that triggers the AutoTask. Any value applied to an asset must match this value exactly, including casing, in order for the task to trigger. If the attribute is a pulldown, multi-select, or tag this value must be an exact match to an existing value option. 

A valid attribute value according to its type

The following task will trigger when an asset is uploaded and its Author attribute is filled with the value Shel Silverstein, the AutoTask will trigger and the asset will be moved to the folder Children's books using the modify parameters. 

<task>
    <matchCriteria type="and">
        <criteria type="action" value="import"></criteria>
        <criteria type="attribute" value="Shel Silverstein" name="Author"></criteria>
    </matchCriteria>
    <modifications>
        <modify path="/Literature/Genres/Children's books" type="category" value="move"/>
    </modifications>
</task>

category

Category-type criteria, when used in conjunction with action criteria, specify that any action criteria must be performed in or on a specific NetX folder. Assets outside the defined folder will not trigger the AutoTask even if they meet the action criteria, such as uploading a new asset to an unrelated folder.

Parameter Description
type

To use category parameters, the AutoTask's criterion type must be category

Value options: category

path

The value of this parameter defines the criteria's folder target using its full folder path prefaced with a /; e.g. /Parent folder/child folder/AutoTask folder, where AutoTask folder is the target folder for the AutoTask action.

Value options: folder path

recursive

If the value of this parameter is true, subfolders of the folder defined in the path parameter will be included in the AutoTask without being specifically defined. If the value of this parameter is false, the task will only apply to the folder specified by the path parameter. 

Value options: true / false

 

This task will trigger when an asset is uploaded to the folder Images — or any of its subfolders — the AutoTask will trigger and send a notification email to netxautotasks@netx.net with the specified email template.

<task>
    <matchCriteria type="and">
        <criteria type="action" type="import"></criteria>
        <criteria type="category" path="/File types/Images" recursive="true"></criteria>
    </matchCriteria>
    <notifications>
        <notify address="netxautotasks@netx.net" emailTemplate="assetImportReport.tpl" type="email"/>
    </notifications>
</task>

group

When group criterion is added to an AutoTask, the task's action criteria will be applied to the group named in the criterion's name parameter. 

Parameter Description
type

To define a group as part of an AutoTask's criteria, the AutoTask's criterion type must be group

Value options: group

name

The name of the group being used as AutoTask criteria. This value must match the group name exactly and is case-sensitive.

Value options: An existing user group

 

This AutoTask will trigger when a member of the group AutoTask net uploads an asset to NetX. When triggered, any uploaded asset(s) will be moved to the folder Approval needed with the modify parameters.

<task>
    <matchCriteria>
        <criteria type="action" value="import"></criteria>
        <criteria type="group" name="AutoTask net"></criteria>
    </matchCriteria>
    <modifications>
        <modify path="/Campaigns/Approval needed" type="category" value="move"/>
    </modifications>
</task>

user

Match criteria that reference a user can use a number of parameters to define the AutoTask's criteria. 

Parameter Description
field

The value of this parameter must correspond to a user field. For more information on various user fields, see importing and exporting user data. This parameter must be used in conjunction with the value parameter to specify a value for the chosen field.

Value options: email / organization / city / state / zip / country

value

The triggering value for the user field parameter. Note that field formats are very specific, e.g. country, which only accepts a shortened country code as a value. For more information regarding user fields and their accepted values, see importing and exporting user data.

Value options: value for the chosen field

type

To define a user parameter, the AutoTask's criterion type must be user

Value options: user

login

The value of this parameter must match an existing NetX username, and will indicate that the AutoTask should only trigger when the task's action is performed on or by the specified user. This value is case-sensitive.

Value options: user name

level

 The value of this parameter must correspond to the numerical user level equivalent.

Value options: user level

This AutoTask will trigger when a user whose organization value is NetX is added to the group AutoTask Net. When triggered, an email notification will be sent to netxautotasks@netx.net using the specified email template.

<task>
	<matchCriteria type="and">
        <criteria name="AutoTask Net" type="action" value="userGroupAdd"></criteria>
		<criteria type="user" field="organization" value="NetX"></criteria>
	</matchCriteria>
	<notifications>
        <notify address="netxautotasks@netx.net" emailTemplate="newUser.tpl" type="email"/>
    </notifications>
</task>
Was this article helpful?
0 out of 0 found this helpful