Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control document Workflow state through API Rest #1273

Open
vergelli opened this issue Jul 23, 2021 · 3 comments
Open

Control document Workflow state through API Rest #1273

vergelli opened this issue Jul 23, 2021 · 3 comments

Comments

@vergelli
Copy link

I wonder if there is an option that lets me take control of the document Workflow through the API rest.

In the case of base Redmine, there isn't such an option so I know at least one plugin that allows you to do it. But I don't know if it would be compatible with DMSf.

@picman
Copy link
Collaborator

picman commented Aug 2, 2021

No, there is no such option. The plugin is not compatible with DMSF.

@vergelli
Copy link
Author

vergelli commented Aug 2, 2021

I was thinking of a feature that would allow me to do this.

If I look at a regular GET request of a document I usually get something like this:


{'dmsf_file': {'id': 100,
  'title': 'Title.pdf',
  'name': 'Title.pdf',
  'project_id': 49,
  'content_url': 'url:port/dmsf/files/100/download',
  'dmsf_file_revisions': [{'id': 106,
    'source_dmsf_file_revision_id': 105,
    'name': 'Title.pdf',
    'dmsf_string': '{{dmsf(100,Title.pdf,106)}}',
    'content_url': 'url:port/dmsf/files/100/view?download=106',
    'size': 604894,
    'mime_type': None,
    'title': 'Title.pdf',
    'description': 'REST API asdasd',
    'workflow': None,
    .
    .
    .
}

I can see there is a Workflow field under the Description field.

It would be good to have a feature that allows me to set a value there and impact on Redmine, for example:

This is a file upload commit JSON, and at the end, is the workflow field with a value assigned.

body = {
  "attachments": {
    "folder_id": "21",
    "uploaded_file": {
      "name": "No_name.pdf",
      "title": "Notitle.pdf",
      "description": "No_description",
      "comment": "No_description",
      "version": "3",
      "token": token,
      "workflow": 3

    }
  }
}

And this is a document revision json:

body = {
  "dmsf_file_revision": {
    "title": "title",
    "name": "name",
    "description": "description",
    "comment": "comment",
    'workflow': 2
  }
}

Do you think this could be possible to have?

Regards

@picman
Copy link
Collaborator

picman commented Aug 2, 2021

It is not so simple. An approval workflow loop consists of assignment, start and approvals. All of these steps are related to a file's revision. For each we would have to implement an independent REST API call (to enable existing methods for REST API).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants