Index: Leahi/Jira/Jira_Create_Story.sh =================================================================== diff -u -r9b14981f5201d9a1a9ce6ad12e1425b7aa351034 -r1ef58141bdb00e0aede0625aebb17b4b39e65879 --- Leahi/Jira/Jira_Create_Story.sh (.../Jira_Create_Story.sh) (revision 9b14981f5201d9a1a9ce6ad12e1425b7aa351034) +++ Leahi/Jira/Jira_Create_Story.sh (.../Jira_Create_Story.sh) (revision 1ef58141bdb00e0aede0625aebb17b4b39e65879) @@ -243,13 +243,69 @@ )" local RESULT=$? - echo $USER_INFO + echo "$USER_INFO" echo $RESULT } +children() { + local CHILDREN="$( curl \ + -X GET \ + -u "$JIRA_USER:$JIRA_API_TOKEN" \ + -H "Content-Type: application/json" \ + "$JIRA_BASE_URL/rest/api/3/search?jql=parent=$1" \ + | jq -r '.issues[] | "\(.key) - \(.fields.summary)"' \ + | sed -e '1!G;h;$!d' \ + )" + local RESULT=$? + echo "$CHILDREN" +} + +linkTypes() { + local linktype="$( curl \ + -X GET \ + -u "$JIRA_USER:$JIRA_API_TOKEN" \ + -H "Content-Type: application/json" \ + "$JIRA_BASE_URL/rest/api/3/issueLinkType" \ + | jq -r '.issueLinkTypes[] | "\(.name) : \(.inward) - \(.outward)"'\ + )" + local RESULT=$? + echo "$linktype" +} + +linkIssues() { + local type="Polaris issue link" + local inwardIssue="$1" + local outwardIssue="$2" + local RESPONSE="$( curl \ + -s -X POST \ + --url "$JIRA_BASE_URL/rest/api/3/issueLink/" \ + --user "$JIRA_USER:$JIRA_API_TOKEN" \ + --header "Content-Type: application/json" \ + --data '{ + "type" : { "name": "'"$type"'" }, + "inwardIssue" : { "key" : "'"$inwardIssue"'" }, + "outwardIssue" : { "key" : "'"$outwardIssue"'" } + }' + )" + echo "$RESPONSE" +} + ## Main code echo "" +# WIP : TESTING +# linkTypes +# children "$1" +# linkIssues "$1" "$2" +# # └ β ./Jira_Create_Story.sh LEAH-2078 LDT-116 +# exit 0 + + #./Jira_Create_Story.sh \ + # "Application: clean up the application for Leahi" \ + # "The application which is currently using the Denali code base needs to get cleaned up by removing the Model, View, and controller modifications to get ready for adding Leahi new messages.\nThe cleaned up application need to be buildable and executable and be able to run with -L that has been defined to use only for logging." \ + # LEAH \ + # 5d6f09ceab129d0c306d9ddb + SUMMARY="$1" DESCRIPTION="$2" PROJECT_KEY="$3" @@ -259,7 +315,6 @@ if [ "$2" = "" ]; then echo "ERROR_MISSING_USERNAME" exit $ERROR_MISSING_USERNAME - fi userInformation $2 exit 0