Hi,
we are unable to get or store project key and project name using SIL script
can 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 response
As 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 name
Solution:- 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) :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Anna,
we followed below script which you have provided,
string datetime =currentDate();
string allprojs= allProjects();
printInFile("myprojects.txt", datetime+ " - " + allprojs);
but output we got only as "DONE", it was not displaying any projects or keys.
Can you help us to here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The list of projects will not appear in the console, it should be added to the newly created file myprojects.txt inside the silprograms folder. If you want to get output in the console window, you need to add
runnerLog( datetime+ " - " + allprojs);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.