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

Refresh project list? #91

Open
elmundio87 opened this issue Feb 15, 2018 · 3 comments
Open

Refresh project list? #91

elmundio87 opened this issue Feb 15, 2018 · 3 comments

Comments

@elmundio87
Copy link

I'm having some issues with the list of projects present in the "Enabled Projects" section.

Some of the projects in the list no longer exist on Jira (so will cause an HTTP 400 error if enabled in the workflow), and several new Jira projects are missing from the list.

If I uncheck "limit query to enabled projects" I can see tickets from those missing projects.

Is there a way to refresh the list to remove old projects and add the new ones?

@steyep
Copy link
Owner

steyep commented Feb 15, 2018

Running this from the alfred-jira directory should refresh your settings for you:

node << 'EOF'
const fs = require('fs');
const AJ = require('./lib/jira');
const configPath = `${process.env.HOME}/.alfred-jira/config.json`;
let config = require(configPath);
let disabled = config.options.available_projects.filter(s => !s.enabled).map(s => s.name);
AJ.getProjects().then(projects => {
  projects.map(s => { s.enabled = !disabled.includes(s.name); return s });
  config.options.available_projects = projects;
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
});
EOF

@elmundio87
Copy link
Author

Thanks, that script added the missing projects!

@neohunter
Copy link

+1 I have the same issue with the statuses

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

3 participants