In CodeCommit, Is there a support to list PullRequests in console to filter by lastActivityDate by passing any querystring?

0

Console does not allow filtering view of PullRequests list by last activity date. Is there any internal querystring param that can be sent to filter like lastActivityDate < 7 days

https://us-east-1.console.aws.amazon.com/codesuite/codecommit/repositories/<reponame>/pull-requests?region=us-east-1&status=OPEN

질문됨 2년 전292회 조회
1개 답변
0

Hi there,

Hope you are doing well! I understand you want to know if there is a filter on the CodeCommit Console so you can filter out PullRequests activities.

Currently, there is no filter on the CodeCommit Console. Alternatively, you may consider using AWS API/CLI command, which can filter it using the following script:

RepoName="RepoName" #Please change the Repo name
todate="2022-12-20"   #Please change the date you want to find by
todateN=$(date -d $todate +%s)

aws codecommit list-pull-requests --repository-name  $RepoName | jq -c '.pullRequestIds[]' | while read prID; do
    prNumber=$(echo "${prID//\"}")  # remove "
    prDetetails=$(aws codecommit get-pull-request --pull-request-id $prNumber)
    # echo $prDetetails | jq '.pullRequest.lastActivityDate'
    prNumber=$(echo "${prID//\"}")  # remove "
    prLastActivityDateTime=$(echo $prDetetails | jq '.pullRequest.lastActivityDate')
    prLastActivityDate=$(echo $prLastActivityDateTime| awk '{ print substr( $0, 2, length($0)-24 ) }')
    # echo prLastActivityDate: $prLastActivityDate
    prLastActivityDateN=$(date -d $prLastActivityDate +%s)
    #echo prLastActivityDate: $prLastActivityDate $prLastActivityDateN 
    if [ $prLastActivityDateN -ge $todateN ];
    then
        echo $prDetetails | jq '.pullRequest | "\(.pullRequestId) \(.lastActivityDate)"'
    fi  
done

Please note that the code above is for your use-case reference only, effort for developing and debugging your own code is required.

AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠