Hi Everybody,
I'm working on server JIRA add-on, which can create projects and issues with time tracking properties.
I'm using jwt token to sign all my requests. Create project, Get Project, Create Issue and others work completely fine. No questions about it.
However, I cannot create an issue with timetracking field. When I do create a new project via API, it creates a default screen for this project. This default screen doesn't have timetracking fields added. Here is where all the fun begins.
Using Create Issue End-Point is not an option, because it's returning an error because "timetracking" field is not visible on the screen.
First thing came to my mind is to edit default screen for the project, however for some reason Apps are not allowed to use Get Screens End-Point.
quote: "Apps cannot access this REST resource."
Nonetheless, Apps are allowed to modify screens by providing screenId. But how can I get screenId if I cannot query screens? Quite silly, right?
Anyway, since modifying screen is not an option with Rest API, I've started to dig deeper and have found out that Update Issue End-Point has "overrideScreenSecurity" parameter:
quote: "Allows update of the fields that are hidden from the issue’s Edit screen. Only Connect add-on users with admin scope permission are allowed to use this flag."
Nevertheless, each time I'm sending put request with overrideScreenSecurity parameter set to true, I'm getting 401 - Unauthorized. Without this param everything is working fine. The most interesting thing is that I do have admin scope permission in my atlassian-connect.json file.
Details:
Url: https://{instance}.atlassian.net/rest/api/2/issue/{id}?overrideScreenSecurity=true
Method: PUT
Body:
{ "update": { "timetracking":[ { "edit": { "originalEstimate":"10d", "remainingEstimate":"10d" } } ] } }
I'm signing every request with Authorization header and JWT. It works fine for other requests, so I don't think it makes sense to share my JWT here.
Response:
Status: 401 Unauthorized
My atlassian-connect.json file:
{ "name": "App Name", "description": "App Description", "key": "com.estimatish.io", "baseUrl": "https://88fd8d35.ngrok.io/", "vendor": { "name": "App, Inc.", "url": "http://app.io" }, "authentication": { "type": "jwt" }, "lifecycle": { "installed": "/callback/installed", "uninstalled": "/callback/uninstalled", "enabled": "/callback/enabled", "disabled": "/callback/disabled" }, "apiVersion": 1, "scopes": [ "admin", "read", "write", "project_admin", "act_as_user" ], "modules": {} }
Do you have any idea how I can create issue with filled timetracking field using JIRA Rest API or at least point me to the right direction?
Appreciate it, thanks!
Using JIRA Mac App appears the same problem.
Am very curious what you have learned since 2018 regarding time tracking...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Quick Update:
I was able to generate OAuth2 access token for my user and tried to update issue with timetracking values. Same error:
{"errorMessages":["Only Connect add-on users with admin scope permission are allowed to override screen security."],"errors":{}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.