Jump to content

Workflow - Chaining Script Filters


Recommended Posts

I am creating a workflow that will:

 

1. Present a list of Fogbugz projects

2. Given the selected project, present a list of Fogbugz milestones within the project

3. Given the selected project and milestone, send details of the cases (tasks) within the milestone to the clipboard

 

Project > Milestone > Cases

 

I'm using python as my preferred scripting language in the workflow. I've also followed the examples provided for chaining workflows together (http://www.alfredforum.com/topic/1283-how-to-script-filters-reusing-a-single-script-filter-or-chaining-multiple-together/). I'm also using the alp python library (). I've also written a python library with getProjects, getMilestones, and getCases functions, separately tested and working as expected. 

 

I tried following the demo3 example, but had a really hard time getting the workflow to call itself again and I can only get the projects list to display. I tried following demo1, but the issue I am running into is that only the list of projects is ever displayed. 

 

Here's the general layout of the workflow:

 

1.0 Script Filter (fbProject, displays list of projects) > 1.1 Run Script (stores the id {query} of the selected project in settings) > Run Script (calls fbMilestone via AppleScript)

 

2.0 Script Filter (fbMilestone, gets stored id of selected project from settings, displays list of milestones) > 2.1 Run Script (stores the id {query} of the selected milestone in settings, gets the stored project id, prints a string with both ids) > Output (Post Notification + Clipboard for now)

 

The problem is that fbMilestone always displays the list of projects. Even if I just hard-code a project id and execute fbMilestone directly, it always displays projects. If I log what's "printed" from the Script Filter, it shows the milestones in Xml, as expected, but still the projects display:

 

 
[: 1.0.Starting fbProject (2013-11-05-09:13:43)]
[: 1.0.Getting token (2013-11-05-09:13:43)]
[: 1.0.Getting projects (2013-11-05-09:13:44)]
[: 1.0.Projects Xml: <?xml version="1.0"?><items><item arg="55" isValid="True" uid="fbp55"><title>3PL</title><subtitle>3PL</subtitle></item><item arg="54" isValid="True" uid="fbp54"><title>Auto Delivery</title><subtitle>Auto Delivery</subtitle></item><item arg="6" isValid="True" uid="fbp6"><title>Code Reviews</title><subtitle>Code Reviews</subtitle></item><item arg="22" isValid="True" uid="fbp22"><title>Content</title><subtitle>Content</subtitle></item><item arg="18" isValid="True" uid="fbp18"><title>Customer Service</title><subtitle>Customer Service</subtitle></item><item arg="20" isValid="True" uid="fbp20"><title>Design</title><subtitle>Design</subtitle></item><item arg="34" isValid="True" uid="fbp34"><title>Email Capture Techniques</title><subtitle>Email Capture Techniques</subtitle></item><item arg="17" isValid="True" uid="fbp17"><title>External Jeeves</title><subtitle>External Jeeves</subtitle></item><item arg="15" isValid="True" uid="fbp15"><title>Help Desk</title><subtitle>Help Desk</subtitle></item><item arg="2" isValid="True" uid="fbp2"><title>Inbox</title><subtitle>Inbox</subtitle></item><item arg="52" isValid="True" uid="fbp52"><title>Infrastructure</title><subtitle>Infrastructure</subtitle></item><item arg="19" isValid="True" uid="fbp19"><title>Panel Test</title><subtitle>Panel Test</subtitle></item><item arg="21" isValid="True" uid="fbp21"><title>PM Project</title><subtitle>PM Project</subtitle></item><item arg="53" isValid="True" uid="fbp53"><title>Project Milestones</title><subtitle>Project Milestones</subtitle></item><item arg="51" isValid="True" uid="fbp51"><title>Promotion Engine</title><subtitle>Promotion Engine</subtitle></item><item arg="14" isValid="True" uid="fbp14"><title>Technology</title><subtitle>Technology</subtitle></item></items> (2013-11-05-09:13:45)]
[: 1.0.Done (2013-11-05-09:13:45)]
[: 1.1.Storing project id from query as 54 (2013-11-05-09:13:48)]
[: 1.1.Next step is fbMilestones (2013-11-05-09:13:48)]
[: 1.1.Done (2013-11-05-09:13:48)]
[: 2.0.Getting settings (2013-11-05-09:13:50)]
[: 2.0.Project id is: 54 (2013-11-05-09:13:50)]
[: 2.0.Getting milestones (2013-11-05-09:13:50)]
[: 2.0.Milestones Xml: <?xml version="1.0"?><items><item arg="1" isValid="True" uid="fbm1"><title>Undecided</title><subtitle>Undecided</subtitle></item><item arg="937" isValid="True" uid="fbm937"><title>Sprint 1-6</title><subtitle>Sprint 1-6</subtitle></item><item arg="931" isValid="True" uid="fbm931"><title>Sprint 13.41</title><subtitle>Sprint 13.41</subtitle></item><item arg="932" isValid="True" uid="fbm932"><title>Sprint 13.43</title><subtitle>Sprint 13.43</subtitle></item><item arg="934" isValid="True" uid="fbm934"><title>Sprint 13.45</title><subtitle>Sprint 13.45</subtitle></item><item arg="935" isValid="True" uid="fbm935"><title>Sprint 13.47</title><subtitle>Sprint 13.47</subtitle></item><item arg="957" isValid="True" uid="fbm957"><title>Release 1 - Deployment</title><subtitle>Release 1 - Deployment</subtitle></item><item arg="933" isValid="True" uid="fbm933"><title>Backlog</title><subtitle>Backlog</subtitle></item></items> (2013-11-05-09:13:51)]
[: 2.0.Done (2013-11-05-09:13:51)]
[: 2.1.Storing milestone id from query as 54 (2013-11-05-09:13:54)]
[: 2.1.Project id is: 54 (2013-11-05-09:13:54)]
[: 2.1.Outputting: 54:54 (2013-11-05-09:13:54)]
[: 2.1.Done (2013-11-05-09:13:54)]
 
 
In Step 2.0, you can see that the python script correctly gets the milestones but, in that step, the list of projects is displayed. In the final output, you can see that the two ids are from the project (54).
 
I am really baffled as to why the projects list is displayed in fbMilestones. 
 
Any ideas?
 
 

 

 

Link to comment

I am creating a workflow that will:

 

1. Present a list of Fogbugz projects

2. Given the selected project, present a list of Fogbugz milestones within the project

3. Given the selected project and milestone, send details of the cases (tasks) within the milestone to the clipboard

 

Project > Milestone > Cases

 

I'm using python as my preferred scripting language in the workflow. I've also followed the examples provided for chaining workflows together (http://www.alfredforum.com/topic/1283-how-to-script-filters-reusing-a-single-script-filter-or-chaining-multiple-together/). I'm also using the alp python library (http://www.alfredforum.com/topic/2030-workflow-libraries-and-helpers/). I've also written a python library with getProjects, getMilestones, and getCases functions, separately tested and working as expected. 

 

I tried following the demo3 example, but had a really hard time getting the workflow to call itself again and I can only get the projects list to display. I tried following demo1, but the issue I am running into is that only the list of projects is ever displayed. 

 

Here's the general layout of the workflow:

 

1.0 Script Filter (fbProject, displays list of projects) > 1.1 Run Script (stores the id {query} of the selected project in settings) > Run Script (calls fbMilestone via AppleScript)

 

2.0 Script Filter (fbMilestone, gets stored id of selected project from settings, displays list of milestones) > 2.1 Run Script (stores the id {query} of the selected milestone in settings, gets the stored project id, prints a string with both ids) > Output (Post Notification + Clipboard for now)

 

The problem is that fbMilestone always displays the list of projects. Even if I just hard-code a project id and execute fbMilestone directly, it always displays projects. If I log what's "printed" from the Script Filter, it shows the milestones in Xml, as expected, but still the projects display:

 

 

[: 1.0.Starting fbProject (2013-11-05-09:13:43)]

[: 1.0.Getting token (2013-11-05-09:13:43)]

[: 1.0.Getting projects (2013-11-05-09:13:44)]

[: 1.0.Projects Xml: <?xml version="1.0"?><items><item arg="55" isValid="True" uid="fbp55"><title>3PL</title><subtitle>3PL</subtitle></item><item arg="54" isValid="True" uid="fbp54"><title>Auto Delivery</title><subtitle>Auto Delivery</subtitle></item><item arg="6" isValid="True" uid="fbp6"><title>Code Reviews</title><subtitle>Code Reviews</subtitle></item><item arg="22" isValid="True" uid="fbp22"><title>Content</title><subtitle>Content</subtitle></item><item arg="18" isValid="True" uid="fbp18"><title>Customer Service</title><subtitle>Customer Service</subtitle></item><item arg="20" isValid="True" uid="fbp20"><title>Design</title><subtitle>Design</subtitle></item><item arg="34" isValid="True" uid="fbp34"><title>Email Capture Techniques</title><subtitle>Email Capture Techniques</subtitle></item><item arg="17" isValid="True" uid="fbp17"><title>External Jeeves</title><subtitle>External Jeeves</subtitle></item><item arg="15" isValid="True" uid="fbp15"><title>Help Desk</title><subtitle>Help Desk</subtitle></item><item arg="2" isValid="True" uid="fbp2"><title>Inbox</title><subtitle>Inbox</subtitle></item><item arg="52" isValid="True" uid="fbp52"><title>Infrastructure</title><subtitle>Infrastructure</subtitle></item><item arg="19" isValid="True" uid="fbp19"><title>Panel Test</title><subtitle>Panel Test</subtitle></item><item arg="21" isValid="True" uid="fbp21"><title>PM Project</title><subtitle>PM Project</subtitle></item><item arg="53" isValid="True" uid="fbp53"><title>Project Milestones</title><subtitle>Project Milestones</subtitle></item><item arg="51" isValid="True" uid="fbp51"><title>Promotion Engine</title><subtitle>Promotion Engine</subtitle></item><item arg="14" isValid="True" uid="fbp14"><title>Technology</title><subtitle>Technology</subtitle></item></items> (2013-11-05-09:13:45)]

[: 1.0.Done (2013-11-05-09:13:45)]

[: 1.1.Storing project id from query as 54 (2013-11-05-09:13:48)]

[: 1.1.Next step is fbMilestones (2013-11-05-09:13:48)]

[: 1.1.Done (2013-11-05-09:13:48)]

[: 2.0.Getting settings (2013-11-05-09:13:50)]

[: 2.0.Project id is: 54 (2013-11-05-09:13:50)]

[: 2.0.Getting milestones (2013-11-05-09:13:50)]

[: 2.0.Milestones Xml: <?xml version="1.0"?><items><item arg="1" isValid="True" uid="fbm1"><title>Undecided</title><subtitle>Undecided</subtitle></item><item arg="937" isValid="True" uid="fbm937"><title>Sprint 1-6</title><subtitle>Sprint 1-6</subtitle></item><item arg="931" isValid="True" uid="fbm931"><title>Sprint 13.41</title><subtitle>Sprint 13.41</subtitle></item><item arg="932" isValid="True" uid="fbm932"><title>Sprint 13.43</title><subtitle>Sprint 13.43</subtitle></item><item arg="934" isValid="True" uid="fbm934"><title>Sprint 13.45</title><subtitle>Sprint 13.45</subtitle></item><item arg="935" isValid="True" uid="fbm935"><title>Sprint 13.47</title><subtitle>Sprint 13.47</subtitle></item><item arg="957" isValid="True" uid="fbm957"><title>Release 1 - Deployment</title><subtitle>Release 1 - Deployment</subtitle></item><item arg="933" isValid="True" uid="fbm933"><title>Backlog</title><subtitle>Backlog</subtitle></item></items> (2013-11-05-09:13:51)]

[: 2.0.Done (2013-11-05-09:13:51)]

[: 2.1.Storing milestone id from query as 54 (2013-11-05-09:13:54)]

[: 2.1.Project id is: 54 (2013-11-05-09:13:54)]

[: 2.1.Outputting: 54:54 (2013-11-05-09:13:54)]

[: 2.1.Done (2013-11-05-09:13:54)]

 

 

In Step 2.0, you can see that the python script correctly gets the milestones but, in that step, the list of projects is displayed. In the final output, you can see that the two ids are from the project (54).

 

I am really baffled as to why the projects list is displayed in fbMilestones. 

 

Any ideas?

Without looking at it it's hard to determine what the issue is. It seems as if you have the flow of how to do it figured out and everything working correctly. Any way that you could share it and let me look at it for a sec?

Link to comment

I figured it out. When I was cleaning up the code to send it your way, I removed some test code at the bottom of the FogbugzNav.py file. Later when I went back to it, I saw it was working and realized that test code was interfering with the workflow. Ug... 

 

Ha nice. Glad you got it working

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...