Achievement automations are used to enable community managers to automate the awarding and revoking of achievements.
Why would I implement an achievement automation?
If you want to enable custom automation logic of achievements and add a new capability to the automation list in achievement management (Administration > Membership > Achievements), you should create a custom achievement automation.
How do I create a custom achievement automations?
To create an achievement automation, when creating a new automation in Automation Studio, select "Achievement automations" as the target.
Achievement automations are executed within the context of a single achievement--the achievement they are automating. Along with all other automation capabilities and trigger types, achievement automations get a private API to interact with their associated achievement: context_v1_achievementAutomation
. This API provides the following members to enable achievement automation:
- AchievementId. This is the identifier of the achievement being automated.
- Award(userId). Awards the achievement to the provided user.
- IsAwarded(userId). Returns true if the achievement is already awarded to the user, otherwise false.
- Revoke(userId). Revokes the achievement from the user provided.
An achievement automation should use appropriate triggers to identify when a user could potentially be awarded an achievement as well as detect when the implemented criteria logic is no longer met and the achievement should be revoked. The automation can use the private context_v2_achievementAutomation
API, then, to implement the decision to award or revoke the achievement based on its implemented criteria logic.
Once an achievement automation is created, it can be used when creating or editing an achievement. Once associated, an instance of the automation will be created and enabled to automate the associated achievement.