- Simplified the title prop in `FilterBar` for better readability. - Updated dependency array in `useJiraFilters` to include `filterAnalyticsLocally`, ensuring proper effect execution. - Added new line at the end of `test-jira-fields.ts` and `test-story-points.ts` for consistency.
84 lines
3.0 KiB
TypeScript
84 lines
3.0 KiB
TypeScript
#!/usr/bin/env tsx
|
|
|
|
/**
|
|
* Script pour identifier les champs personnalisés disponibles dans Jira
|
|
* Usage: npm run test:jira-fields
|
|
*/
|
|
|
|
import { JiraService } from '../src/services/integrations/jira/jira';
|
|
import { userPreferencesService } from '../src/services/core/user-preferences';
|
|
|
|
async function testJiraFields() {
|
|
console.log('🔍 Identification des champs personnalisés Jira\n');
|
|
|
|
try {
|
|
// Récupérer la config Jira
|
|
const jiraConfig = await userPreferencesService.getJiraConfig();
|
|
|
|
if (!jiraConfig.enabled || !jiraConfig.baseUrl || !jiraConfig.email || !jiraConfig.apiToken) {
|
|
console.log('❌ Configuration Jira manquante');
|
|
return;
|
|
}
|
|
|
|
if (!jiraConfig.projectKey) {
|
|
console.log('❌ Aucun projet configuré');
|
|
return;
|
|
}
|
|
|
|
console.log(`📋 Analyse du projet: ${jiraConfig.projectKey}`);
|
|
|
|
// Créer le service Jira
|
|
const jiraService = new JiraService(jiraConfig);
|
|
|
|
// Récupérer un seul ticket pour analyser tous ses champs
|
|
const jql = `project = "${jiraConfig.projectKey}" ORDER BY updated DESC`;
|
|
const issues = await jiraService.searchIssues(jql);
|
|
|
|
if (issues.length === 0) {
|
|
console.log('❌ Aucun ticket trouvé');
|
|
return;
|
|
}
|
|
|
|
const firstIssue = issues[0];
|
|
console.log(`\n📄 Analyse du ticket: ${firstIssue.key}`);
|
|
console.log(`Titre: ${firstIssue.summary}`);
|
|
console.log(`Type: ${firstIssue.issuetype.name}`);
|
|
|
|
// Afficher les story points actuels
|
|
console.log(`\n🎯 Story Points actuels: ${firstIssue.storyPoints || 'Non défini'}`);
|
|
|
|
console.log('\n💡 Pour identifier le bon champ story points:');
|
|
console.log('1. Connectez-vous à votre instance Jira');
|
|
console.log('2. Allez dans Administration > Projets > [Votre projet]');
|
|
console.log('3. Regardez dans "Champs" ou "Story Points"');
|
|
console.log('4. Notez le nom du champ personnalisé (ex: customfield_10003)');
|
|
console.log('5. Modifiez le code dans src/services/integrations/jira/jira.ts ligne 167');
|
|
|
|
console.log('\n🔧 Champs couramment utilisés pour les story points:');
|
|
console.log('• customfield_10002 (par défaut)');
|
|
console.log('• customfield_10003');
|
|
console.log('• customfield_10004');
|
|
console.log('• customfield_10005');
|
|
console.log('• customfield_10006');
|
|
console.log('• customfield_10007');
|
|
console.log('• customfield_10008');
|
|
console.log('• customfield_10009');
|
|
console.log('• customfield_10010');
|
|
|
|
console.log('\n📝 Alternative: Utiliser les estimations par type');
|
|
console.log('Le système utilise déjà des estimations intelligentes:');
|
|
console.log('• Epic: 13 points');
|
|
console.log('• Story: 5 points');
|
|
console.log('• Task: 3 points');
|
|
console.log('• Bug: 2 points');
|
|
console.log('• Subtask: 1 point');
|
|
|
|
} catch (error) {
|
|
console.error('❌ Erreur lors du test:', error);
|
|
}
|
|
}
|
|
|
|
// Exécution du script
|
|
testJiraFields().catch(console.error);
|
|
|