Hi,
we are unable to get or store project key and project name using SIL scriptcan someone help us here pls ?
Hi @Mohan Reddy KRISHNAREDDYGARI ,
Could you please share a bit of context on how and when you are trying to get this information?
If you are running just SIL script from SIL Manager and have in context some particular Jira issue , you can get the project key as :
return project;
Please see the full list of standard variables like project via link
Also, you may be interested in routine getProjectKeyByName which will give project key by project name
If, for example, you are running listener, you can get project information via getProjectFromEvent()routine using JProject structure, which contains project id, key, name etc.
If that doesn`t help, please describe your use case and I will be glad to help you. Anna
Hi Anna, Thanks for your responseAs a Business admin, I want to restore a project that would be for some reasons deleted
Automated way to have the Project key and project nameSolution:- SIL script
Acceptance criteria;
Having the list of input required by restore process delivered as CSV and scheduled every day and stored on the server (like a backup) :
I am still not sure that I understand what you are trying to set up with SIL particularly. So feel free to correct me in my assumptions.
If you want to collect information about deleted projects, you can configure SIL Listener, which will be triggered by the "Project Deleted" event, so each time someone deletes a project, sil script will be triggered. The example of the script:
printInFile("myprojects.txt", "Result of listener: " + getProjectFromEvent());
as a result, you will see in txt file:
Result of listener: 12000|DEL|del||software|JIRAUSER11200||true|10324|
where in my example DEL is the project key and del is the project name. You even can trigger email sending to some admin person with an alert that some project was deleted.
And another my understanding of your set up:
If you want each day to get the list of all projects you have in your jira - it`s easy. sil script:
string datetime =currentDate();string allprojs= allProjects();printInFile("myprojects.txt", datetime+ " - " + allprojs);
as a result you get file with similar content:
2023-05-25 18:43:33 - APP|COMM|CONF|CM|DB|DEC|DEMO|ES|ES2|JSU|LF|MGR|NY|OCT|PORTAL|SEP|SD|SPRN|THD|TSOT|ZEP
also this script can be run on a daily basis automatically, if you configure sil scheduler
Hope it will give you some idea on solving your problem.
Anna
Hello Anna,
we followed below script which you have provided,
but output we got only as "DONE", it was not displaying any projects or keys.Can you help us to here.
It looks like you're new here. Sign in or register to get started.