task #7269
Updated by Andreas Kohlbecker about 6 years ago
The Redmine issue system will be used to establish asynchronous communication between *curator* and *submitters*, which are also referred to as **contributors**. ## Workflow * All messages are stored in redmine. * For each registration entity a issue is created in redmine, when even a message needs to be passes to submitter or curator * The `User` for the contributor is being created as long as it does not exist in redmine. * A comment to the issue will be created for each message * The user to which the message is dedicated to will be set as *Assignee* and the **Unread flag** is set to `true` * Once the user has read the comment **Unread flag** is set to `false`. * The status of the issue is synchronized with the `Registration.status` * Submitter and Contributor will become watchers of the issue so that both can receive email notifications when a new message is posted. ## Redmine REST api Redmine has a REST api for basic CRUD operations (https://www.redmine.org/projects/redmine/wiki/Rest_api). * Authentication can be done using an API-key passed in as a "X-Redmine-API-Key" HTTP header (added in Redmine 1.1.0) * The API key is provided per user and can be retrieved from the "My account" page: `./my/account` * All operations can be done by an admin user on behalf of an ordinary user by using the HTTP header (X-Redmine-Switch-User: jsmith). This only works when using the API with an administrator account! For our purpose the Issue and User services are relevant: **[Users](https://www.redmine.org/projects/redmine/wiki/Rest_Users)** * Create a user: `POST /users.json` ~~~json { "user": { "login": "jplang", "firstname": "Jean-Philippe", "lastname": "Lang", "mail": "jp_lang@yahoo.fr", "password": "secret" } } ~~~ **[Issues](https://www.redmine.org/projects/redmine/wiki/Rest_Issues)** * Create an issue: `POST /issues.json` ~~~json { "issue": { "project_id": 1, "subject": "Registration: ${Registration.identifier}", "priority_id": 1 4 } } ~~~ * Add comment: * Change custom field `Unread`: * Find an issue by registrationId: `GET /issues.xml?cf_1=${Registration.identifier}` * here cf_1 refers to the custom field with id=1, which is the `Identifier` field ### id in redmine.phycobank.org * Project id = `phycobank-registry` * Tracker *registration* = 1 * Custom field ids: * Identifier = 1 * Submitter = 2 * Curator = 3 * Unread = 4 * Issue statuses: * preparation = 1 * curation = 2 * ready = 3 * published = 4 * rejected = 5 * Issue priorities: * default = 1 ## Implementation requirements: **Settings:** * adminUserApiKey * redmineURL * projectId