when i run following command on terminal it works and post value the the issue but when i run the same command from .sh script file it doesnt work and gives out error
curl --insecure -u "username":$cat(password.txt) -X PUT --data '{"fields" : {"customfield_10301" : "value"} }' -H "Content:application/json" https://url/rest/api/2/issue/(issueid)
it give following error
cat password.txt command not found
curl --insecure -u "username":$cat(password.txt) -X PUT --data '{"fields" : {"customfield_10301" : "value"} }' -H "Content:application/json" https://url/rest/api/2/issue/(issueid : No such file or directory
Answer
I would suggest to put the absolute that for password.txt in shell script.
For Eg: if the password.txt is present in /opt/atlassian/jira/password.txt then put $cat(/opt/atlassian/jira/password.txt) in shell script.
I tried that,for example if my password is password123 the cat command will show my password on resuly but at the end same thing no such file or directory
curl --insecure -u "username":password123 -X PUT --data '{"fields" : {"customfield_10301" : "value"} }' -H "Content:application/json" https://url/rest/api/2/issue/(issueid : No such file or directory
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.