Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I automate this process

Monika Rani
Community Champion
August 16, 2023

I have a CSV file and I can create issues from this file using ACLI (runFromcsv) but right now I am manually typing the command in ACLI Client, I want to make it automatic like automatically this command runs on a specific time interval. How can I achieve this?

 

2 answers

1 accepted

1 vote
Answer accepted
Amelie Winkler _Appfire_
Atlassian Partner
August 17, 2023

Hi @Monika Rani, Amelie from the CLI team here!

As you mentioned, on DC/Server, you can use RunCLI Actions in Jira, which isn't available on the cloud (yet!)

 

To run commands automatically, you could schedule your ACLI commands via a scheduling tool (for example, cron scheduler if you're operating on a Linux or Mac system or Windows scheduler if you're on Windows).

If you're in a more complex scenario/development environment and already have a Continuous Integration (CI) tool, Bitbucket pipelines or Bamboo for Atlassian might be better choices. The ACLI docker deliverables (Docker Images for ACLI) are designed to make it easy to use CI pipeline-like tools to incorporate ACLI into existing processes.

Hope this helps!

Monika Rani
Community Champion
August 18, 2023

@Amelie Winkler _Appfire_ I tried the Windows scheduler to run my command.txt file but when the scheduler runs my file, then how did my commands run inside the ACLI terminal and perform the actions?

Let me give you an idea of what I am trying to achieve here:

I want to create issues from my CSV and I am running this command :

--action runFromCsv --file Book1.csv --common "--action createIssue --continue "

and this is working perfectly for me in ACLI client.

Now, I put this command in the command.txt file and this file is under my ACLI installation directory. after that I create a task under my windows scheduler and run this task but nothing happened. 

Can you please check my file?

 

Screenshot 2023-08-18 160404.png

Monika Rani
Community Champion
August 18, 2023

@Amelie Winkler _Appfire_  one more question when I start my ACLI shell why does it ask me "ACLI shell.
? Enter secure properties password:"

I don't want this. How can I resolve this issue?

Screenshot 2023-08-18 164504.png

Amelie Winkler _Appfire_
Atlassian Partner
August 18, 2023

Hi @Monika Rani 

Re/ question 1 on how to execute the command in the Windows scheduler.

  • Create a sample shell file with the below acli action in the acli installation directory.

acli jiracloud --action getProjectList --server https://xyz.atlassian.net --user xyz --token xyz

  • make that file executable using the command: chmod +x filename
  • test the shell by running it in the terminal.

As a next step:

  • Open the terminal and type crontab -e - this will open the crontab terminal
    30 14 * * * /path/to/your_script.sh 0 - add this in the terminal and this script will run every day at 2:30 PM
  • Save and Exit
  • crontab -l with this command, you will be able to view your scheduled jobs.

(Please note above configurations are tested on a Mac and for other environments there will be some differences with configurations.)


Re/ question 2. Secure Properties are a feature of the ACLI to ensure a higher level of credential security. The use of Secure Properties is optional.

Once you have configured the use of Secure Properties, ACLI will require the password before executing any actions. The password can be provided interactively each time ACLI is run, or via an environment variable. If you don't want to use Secure Properties, you can follow the steps mentioned here.


Best, Amelie

Like Laurie Sciutti likes this
Monika Rani
Community Champion
August 21, 2023

@Amelie Winkler _Appfire_  Thank you for your reply. should I need to add --server --user and --token in each and every command? Like if I will have 4 commands in my batch file, it means I will write my command like this :

cmd /c acli jiracloud --action getServerInfo --server XXXX --user XXX --token XX

cmd /c acli jiracloud --action getClientInfo --server XXXX --user XXX --token XX

cmd /c acli jiracloud --action addComment --server XXXX --user XXX --token XX

etc.

is any way where I can put my instance details like users name , server and token and then I can use them here as a form of variable?

Thanks,

Monika

Avinash Bhagawati {Appfire}
Community Champion
August 21, 2023

Hi @Monika Rani ,

You can construct your shell file like the one below.

MY_VAR="acli jiracloud --server XXXX  --user XXXXX  --token XXXXX


$MY_VAR --action getProjectList --limit 3 --outputType table


$MY_VAR --action getProjectList --columns 1,2,3 --outputType table

 In the above example, you will be storing all the server, user and token in single variables then you can use that variable to call in the following actions.

I hope this helps you to achieve your requirement.

Thanks,

Avinash

Monika Rani
Community Champion
August 30, 2023
0 votes
Laurie Sciutti
Community Champion
August 16, 2023

Hi @Monika Rani ~ do you use this as well?  Run CLI Actions in Jira 

Monika Rani
Community Champion
August 16, 2023

@Laurie Sciutti  no i didn't. I am new in automation so I don't have any idea just explored the ACLI only. How I will use it to automatic this can you please let me know.

 

I checked this app (Run CLI Actions in Jira) but it is not available for cloud.

 

Jonathan Bustamante
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 25, 2024

You to read carefully before using or answering the questions 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events