Nikita Meshchaninov Posted July 25, 2020 Share Posted July 25, 2020 Hello I am trying to create an application. And transfer the state from one block to another, and the data has been sent, but the script does not run. What could be the problem?  Debug output: [23:56:06.497] youtrack time[Script Filter] Queuing argument '(null)' [23:56:07.198] youtrack time[Script Filter] Script with argv '(null)' finished [23:56:07.202] youtrack time[Script Filter] {"items": [{"uid": "DOD-7", "title": "DOD-7 \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 real-time", "arg": "DOD-7", "match": "DOD-7", "autocomplete": "DOD-7 1h", "subtitle": "track \"1h\"", "text": {"copy": "DOD-7", "largetype": "DOD-7"}, "valid": true}, {"uid": "DOD-6", "title": "DOD-6 \u041e\u0431\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e yolo \u043d\u0430 \u041b\u042d\u041f", "arg": "DOD-6", "match": "DOD-6", "autocomplete": "DOD-6 1h", "subtitle": "track \"1h\"", "text": {"copy": "DOD-6", "largetype": "DOD-6"}, "valid": true}, {"uid": "DOD-4", "title": "DOD-4 \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u043c\u043e\u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430", "arg": "DOD-4", "match": "DOD-4", "autocomplete": "DOD-4 1h", "subtitle": "track \"1h\"", "text": {"copy": "DOD-4", "largetype": "DOD-4"}, "valid": true}, {"uid": "DOD-8", "title": "DOD-8 \u041f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 TF Serving yolo", "arg": "DOD-8", "match": "DOD-8", "autocomplete": "DOD-8 1h", "subtitle": "track \"1h\"", "text": {"copy": "DOD-8", "largetype": "DOD-8"}, "valid": true}, {"uid": "NPE-1317", "title": "NPE-1317 Alerts 500", "arg": "NPE-1317", "match": "NPE-1317", "autocomplete": "NPE-1317 1h", "subtitle": "track \"1h\"", "text": {"copy": "NPE-1317", "largetype": "NPE-1317"}, "valid": true}, {"uid": "NPE-1059", "title": "NPE-1059 \u041f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b", "arg": "NPE-1059", "match": "NPE-1059", "autocomplete": "NPE-1059 1h", "subtitle": "track \"1h\"", "text": {"copy": "NPE-1059", "largetype": "NPE-1059"}, "valid": true}]} [23:56:08.574] youtrack time[Script Filter] Processing complete [23:56:08.575] youtrack time[Script Filter] Passing output 'DOD-6' to Run Script  Script filter: /usr/bin/env python3 -O issues.py {var:token} {query}  Run Script: echo "{query}" /usr/bin/env python3 -O track_time.py "{query}"  Link to comment
vitor Posted July 25, 2020 Share Posted July 25, 2020 Welcome @Nikita Meshchaninov,  When asking for help with a Workflow, please upload it somewhere (transfer.sh is a fast solution without ads; drop your Workflow in the box in the middle) as we can’t properly help you without access to it. Debugging can already be hard with access to the code, and you’re asking us to guess yours from a description. There are multiple places where your code or Workflow setup may be going wrong. Without looking at it we’re shooting in the dark. Read the Reporting Problems with Workflows topic, as it gives a nice overview on how to build an effective report. Link to comment
Nikita Meshchaninov Posted July 26, 2020 Author Share Posted July 26, 2020 (edited) Ok, i got it. This is my problematic workflow https://alpha.transfer.sh/y1SN9/youtrack time.alfredworkflow Alfred: 4.1 mac OS: 10.15.5 (Catalina) python: 3.7 Â But i'm deleted API_TOKEN and BASE_URL in vars , because such data is dangerous to spread Edited July 26, 2020 by Nikita Meshchaninov Link to comment
Nikita Meshchaninov Posted July 29, 2020 Author Share Posted July 29, 2020 How to make POST request, after press ENTER? This is the essence of my problem Link to comment
deanishe Posted July 29, 2020 Share Posted July 29, 2020 On 7/26/2020 at 6:30 AM, Nikita Meshchaninov said: This is my problematic workflow  You can’t use {var:...} macros in Script boxes. Doesn’t work. If you’re using bash, just use the variable ($YOUTRACK_API_TOKEN). Also, don’t use {query}, use “with input as argv” instead. {query} is a legacy option and is difficult to use because of the escaping (which you have wrong).  8 hours ago, Nikita Meshchaninov said: How to make POST request  If you pass a value for the data argument to urllib.request.urlopen(), it will automatically be a POST request.  If you need full control over the HTTP method, you need to subclass urllib.request.Request and override its get_method() method.  Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now